I am using Glassfish 3.1.1 and trying to get EJB2.x deployment working before moving to EJB3. I have made a small example that is structured like this:
- EAR
- A.jar
ejb-jar.xml
to describe bean A, containing the remote and local interfaces.- the bean also contains a helper class to narrow() the home interface object.
- B.jar
ejb-jar.xml
to describe bean B, containing the remote and local interfaces.- the bean also contains a helper class to narrow() the home interface object.
- C.war
web.xml
contains a servlet and<ejb-local-ref>
tags to point to local interface of beans A and B- war contains code to perform lookup of the local interface and narrow it using the helper class of the bean.
- A.jar
This all deploys and works fine. But when I want to move the lookup code out of the war and move it to a jar that is available under the lib/helper.jar
I get a ClassNotFoundException
on the narrow helper.
Caused by: java.lang.ClassNotFoundException: com.abeloos.glassfish.helper.narrow.calculator.EJBNarrow
at com.sun.enterprise.loader.ASURLClassLoader.findClassData(ASURLClassLoader.java:808)
at com.sun.enterprise.loader.ASURLClassLoader.findClass(ASURLClassLoader.java:696)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
It is almost as if you cannot access the bean code if you come from the lib-path.
精彩评论