Skip to main content

Connecting to an EJB 3.0 Remote SessionBean from Tomcat

3 replies [Last post]
specialhaha
Offline
Joined: 2010-01-15

I 've read this document.

http://technology.amis.nl/blog/1368/connecting-to-an-ejb-30-remote-sessi...

But at tis point, Ididn't find all jar files(appserv-deployment-client.jar, appserv-ext.jar, appserv-rt.jar and javaee.jar). I think it's apllied for v2 and with version3 what must I do?

Now, the Glassfish EJB3.0 FAQ also tells us to make sure that certain Glassfish jar files are in the Tomcat CLASSPATH. This turned out to be the hardest part to do, until I read this message from Kenneth Saks. Kenneth says to import only four jar files from the Glassfish project, being
appserv-deployment-client.jar, appserv-ext.jar, appserv-rt.jar and javaee.jar. These jars can be found inside the lib directory in the Glassfish install directory. As Kenneth states, these jars need to be in the shared/lib directory in the Tomcat install directory. The Tomcat install that comes with NetBeans can be found in the enterprise3/apache-tomcat-5.5.17 dir in the NetBeans install dir.
However, a per user directory containing NetBeans specific stuff exists on your hard disk as well. For Windows users, this directory is located in C:\Documents And Settings\\.netbeans\5.5rc2 and for Linux users, this directory is .netbeans/5.5rc2 in your home dir. This directory contains a directory called apache-tomcat-5.5.17_base which contains tomcat specific stuff. The shared/lib directory should be in here. As you can verify yourself, there is no directory name shared, so create it, create a lib directory in the newly created shared directory and copy the four Glassfish jars mentioned earlier to that directory.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nasradu8
Offline
Joined: 2009-09-03

For glassfish v3 just include glassfishv3/glassfish/modules/gf-client.jar on the classpath.

Simpler method is to write an appclient and deploy it.

specialhaha
Offline
Joined: 2010-01-15

Thanks for your answer.
But I'll include as jar or project or library?
Thnaks a lot

nasradu8
Offline
Joined: 2009-09-03

As a jar. Do not copy the jar file to your project folder. Refer to the gf-client.jar in the glassfish installation directly. This jar depends on many other jars in the installation.