On Mar 25, 2009, at 8:24 AM, [email protected] wrote:

java.lang.NoClassDefFoundError: javax/ejb/EJBHome
       java.lang.Class.forName0(Native Method)
       java.lang.Class.forName(Unknown Source)
       com.sun.naming.internal.VersionHelper12.loadClass(Unknown
Source)
javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
       javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
       javax.naming.InitialContext.init(Unknown Source)
       javax.naming.InitialContext.<init>(Unknown Source)
       org.apache.jsp.Default_jsp._jspService(Default_jsp.java:56)


Looks like you need to add the javaee-api jar to Tomcat/lib. It might work adding it into the WEB-INF/lib, but I haven't tried that -- might make Tomcat mad having two copies of some of the javax.* libraries.

If you plan to access the EJBs from a small number of Tomcat servers, you might want to increase the connection pool size. The default is 5 connections per client. If the openejb-client-jar is in the WEB-INF/ lib, that will be 5 connections per webapp which is a good configuration. If you move the openejb-client jar to the Tomcat/lib directory, you might want to bump it up to maybe 20 as that pool will get shared by all webapps. You can do that with this system property:

   openejb.client.connectionpool.size

Just a note that PortableRemoteObject.narrow isn't required for EJB 3.0 business interfaces (only required for the old javax.ejb.EJBHome/ EJBObject interfaces). So if you'd like to simplify your code you can do that and have it still be compliant.

Hope that helps!

-David

Reply via email to