aspose file tools*
The moose likes JBoss/WildFly and the fly likes jboss deploying ejbs in class path of deployment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "jboss deploying ejbs in class path of deployment" Watch "jboss deploying ejbs in class path of deployment" New topic
Author

jboss deploying ejbs in class path of deployment

Nishanth Alphonse
Greenhorn

Joined: Aug 13, 2010
Posts: 11
Hi there,

I have a situation where I have got Maven to build and deploy an ear file that contains an ejb module. Let's call it A.jar
In the manifest file of the ejb module, I have got maven to include the full classpath using the following:

<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>

One of the items on this classpath is a jar file that contains a list of session beans and is therefore an ejb module. Let's call this B.jar.

Ok back in JBoss when I try to deploy the ear file, I get an error along the lines of :

Caused by: java.lang.IllegalStateException: Null beannMetaData
at org.jboss.ejb3.interceptors.metadata.BeanInterceptorMetaDataBridge.setupMetaDataLists(BeanInterceptorMetaDataBridge.java:315)

Debugging the code, I find that the JBoss5DeploymentUnit is A.jar and that what it's actually trying to get metadata for is a bean in B.jar. Looks like JBoss tries to deploy all the EJBs it can find on the classpath of the deployment under consideration.
I assume, I get the above error because it's not able to get the meta data as the bean is not defined in A.jar but is define in B.jar.

Do you know a way around this? I modify the POM for the EAR file to include B.jar as a EJB module but how can I get JBoss to ignore B.jar when it tries to deploy A.jar.

Many thanks,

Johny

Nishanth Alphonse
Greenhorn

Joined: Aug 13, 2010
Posts: 11
I was able to get aroudn this by writing a ejb-jar.xml files that provides the meta data for each of the beans that is in the dependent jar B.jar.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jboss deploying ejbs in class path of deployment