-
1. Re: Marking a session bean as having pojo dependencies (jboss7/ejb-jar.xml)?
jaikiran May 25, 2011 3:52 AM (in response to dhartford)1 of 1 people found this helpfuldarren hartford wrote:
The question may not necessarily be specific to jbossas7, but it is surfacing there -- I have a session bean that depends on a seperate JAR that contains business objects that are not Entity Beans.
When the ejb-jar gets loaded, I'm seeing 'NoClassDefFoundError' for the business object classes that are contained in the pojo jar.
Where exactly is that jar located in the .ear? If you place that pojo jar in .ear/lib folder (if there isn't a .ear/lib folder, then create one) then all the jars in that lib folder will be available in the classpath of the entire application.
-
2. Re: Marking a session bean as having pojo dependencies (jboss7/ejb-jar.xml)?
dhartford May 26, 2011 11:48 AM (in response to jaikiran)Thanks for the tip above - moving to /lib/ seems to at least make it closer...
This seems to have shifted the issue -- now getting
10:55:49,998 INFO [org.jboss.as.server] (MSC service thread 1-4) Service status report
New missing/unsatisfied dependencies:
service jboss.deployment.subunit."app.ear"."lib/pojo.jar".STRUCTURE (missing)
10:55:50,033 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) Stopped deployment lib/pojo.jar in 27ms
10:55:53,475 INFO [org.jboss.as.server] (MSC service thread 1-4) Service status report
Newly corrected services:
service jboss.deployment.subunit."app.ear"."lib/pojo.jar".STRUCTURE (no longer required)
This is with application.xml defined with:
<module>
<java>lib/pojo.jar</java>
</module>
and the app.ear/lib/pojo.jar file location within the ear (as in, you open the .ear and you see /lib/pojo.jar)
EDIT: if it matters, this was in the log prior to the above --
11:02:10,381 WARN [org.jboss.vfs] (MSC service thread 1-4) VFS was unable to set the URLStreamHandlerFactory. This will have unpredictable results
this is fedora 14, default install, openjdk 1.6.0_20, jboss 7-beta-3, standalone deployment
-
3. Re: Marking a session bean as having pojo dependencies (jboss7/ejb-jar.xml)?
jaikiran May 26, 2011 11:53 AM (in response to dhartford)darren hartford wrote:
This is with application.xml defined with:
<module>
<java>lib/pojo.jar</java>
</module>
Remove that mapping from application.xml. A "java" module is actually a Java EE "application client" which is not what you want. The jars within .ear/lib are by default available in classpath, so you don't have to do anything extra other than just placing those jars there.
-
4. Re: Marking a session bean as having pojo dependencies (jboss7/ejb-jar.xml)?
dhartford May 26, 2011 12:30 PM (in response to jaikiran)thanks, moving to the /lib/ and removing the mapping in the application.xml resolved the issue.
I'm migrating from jboss 4.0.5, and I think I had the EAR setup the current way for a reason, but do not recall exactly. Anyway, now deploying, thanks!