This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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:
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
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.
Joined: Aug 13, 2010
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.