• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Tomcat as Servlet Container and JBoss as App Server

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My current setup is having JBoss 3.0.2 installed and configured as app server on Windows2000 system and I have also created stateless session EJBs and MDBs for my application. I have also tested the same through SIMPLE Java Client and all of them worked in first attempt thanks to simple deployment procedure of JBoss. So far so good. I have installed Tomcat 4.0.1 on the same system.(Please note that I am not supposed to use JBoss with Bundled Tomcat - so I have them separately).
I have also created the following structure in Tomcat
......customer
|
|
+-WEB-INF (placed a web.xml here)
|------> All my Jsps here
+classes (Placed servlets here)
+lib (Here I have placed the client.jar containing home and remote interface classes for a session EJB)
I am now stuck as following:
1) Do I have to copy all the EJB Client jars required mandatorily by JBoss for the working of a EJB Client
2) If I do so and restart Tomcat will the CLASSPATH include the jars present at customer=>WEB-INF=>lib get included and the EJB can be accessed via JNDI or do i have to tweak web.xml as well as server.xml to achieve this.
Please guide me or provide some pointers where such configuration has been successfully achieved
Rgds
Kala
 
Pearlo Muthukumaran
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I sorted out the issue myself.Here are the steps i followed may be of help to others
Step 1)
REM Following are the files to be packed in the Client Deployment
set JBOSS_CLIENT=c:\jboss\jboss-3.0.2\client
set JBOSS_SERVER=c:\jboss\jboss-3.0.2\server
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT%\jboss-j2ee.jar;
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT%\jaas.jar;
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT%\jbosssx-client.jar;
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT%\jboss-client.jar;
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT%\jnp-client.jar;
set CLASSPATH=%CLASSPATH%;%JBOSS_SERVER%\all\lib\jnet.jar;
set CLASSPATH=%CLASSPATH%;%JBOSS_SERVER%\all\lib\log4j.jar;
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT%\log4j.jar;
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT%\jboss-common-client.jar;
REM Following is added to facilitate the JBossMQ Client
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT%\jbossmq-client.jar;
set CLASSPATH=%CLASSPATH%;%JBOSS_CLIENT%\concurrent.jar;1.
Simply copy the above statements into catalina.bat file so that while tomcat is started the servlet container is ready with appropriate CLASSPATH
Step 2)Now create J2EE compliant directory structure into <TOMCAT_HOME>\webapps\
Step 3)Copy the servlet client classes into <TOMCAT_HOME>\webapps\<myapplication>\WEB-INF\classes
Step 4)Make <servlet> and <servlet-mapping> entries in web.xml at WEB-INF directory to suit your servlets
Step 5)Copy the client jar file for home and remote interface references into <TOMCAT_HOME>\webapps\<myapplication>\WEB-INF\lib directory
Step 6)Additional helper classes can be copied to <TOMCAT_HOME>\webapps\<myapplication>\WEB-INF\classes directory
Step 7)Now your servlet can be accessed from browser and if there are no other application level problem the application works fine.
Rgds
Kala
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for sharing your solution, Kala.
 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kala you should also mention that it works with teh standard way FFJ4 (SunOne) IDe installs Tomcat as well..
Very nice!
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have a (probably odd) reply/further question, to this...
I have a similar setup with my JBoss and Tomcat, but I have my web.war compiled with the EJB client remote interfaces etc., then placed into Tomcat/webapps/<app-name>/classes for Tomcat deployment. Note, there is no extra jar in the lib directory. The EJB server-side classes are then compiled into the jar deployed inside JBoss.
The jars mentioned in the first post on this thread are directly copied into the classpath directories of JBoss and Tomcat, rather than modifying their own startup classpath values.
However, I cannot get a handle to the Session EJB's from the servlets. Am I just missing some simple segration here?
Matt.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic