Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jboss deploying ejbs in class path of deployment

 
Nishanth Alphonse
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic