users@glassfish.java.net

Glassfish v3 ejb call from tomcat

From: <glassfish_at_javadesktop.org>
Date: Fri, 09 Apr 2010 10:16:08 PDT

I'm creating an ejb 3 app that has the web front end (GWT) deployed to a Tomcat 6 server, and the business logic in the Glassfish v3 server.
However, I'm not sure how the classpath should be set up to allow the web front end code to call the remote methods on the session beans on the glassfish server.

I have read about including gf-client.jar on the classpath, but whenever I do this with Tomcat the server fails to start with some pretty serious errors:
  java.lang.ClassNotFoundException: org.apache.catalina.core.AprLifecycleListener

Therefore, I have created an appclient.jar using the package-appclient.bat tool, unpacked the produced jar, and copied the jars from the glassfish/modules folder in to the WEB-INF/lib folder of my web project.

This seems to work, the app starts up correctly and is functional. However, I get an exception when starting the tomcat server:
java.lang.NoClassDefFoundError: javax/servlet/ServletContainerInitializer
It seems from the logs that tomcat doesn't load the javax.servlet.jar when the project is loaded, so I assume some other class is looking for this class and not finding it.

The error doesn't seem to have an impact but is a concern.
So my real question is, is there a better way to set this up? Has anyone managed to call ejbs on glassfish v3 from tomcat?
If this is the best way then how do I clear the startup exception? And perhaps adding some additional documentation for people in a similar situation would be good.
[Message sent by forum member 'geekydiamond']

http://forums.java.net/jive/thread.jspa?messageID=396134