-
1. Re: ejb-jar.xml ignored by jbossas-remote-6?
jaikiran Sep 22, 2011 9:43 AM (in response to gunterze)Try changing this
.addAsResource("META-INF/ejb-jar.xml");
to:
.addAsManifestResource("META-INF/ejb-jar.xml", "ejb-jar.xml");
You can also dump the jar contents by doing a
JavaArchive jar = Shrinkwrap.create(...)
jar.toString(true);
That'll show you the actual contents of the jar.
-
2. Re: ejb-jar.xml ignored by jbossas-remote-6?
aslak Sep 22, 2011 10:17 AM (in response to gunterze)The problem is... Arquillian has to somehow communicate with the TestClass to do inconainer testing. In JBossAS6, the defualt is to use the "Servlet 3.0" Protocol for communication, which implies that a Servlet has to be included in the deployment somehow. The DeploymentPackager that comes with the Servlet 3.0 protocol will 'rewrite' your defined @Deployment so it can communicate with it.
In this case where you define a JavaArchive, The Servlet 3.0 Protocol will rewrite that as a WebArchive and place your JavaArchive in WEB-INF/lib (pluss adding some other libs to WEB-INF/lib that registeres a web-fragment and so on)
The EJB 3.1 spec states:
"A .war may contain an ejb-jar.xml file. If present, the ejb-jar.xml is packaged as WEB-INF/ejb-jar.xml."
Since your JavaArchive is placed under WEB-INF/lib, from the container view ejb-jar.xml is now located in WEB-INF/lib/test.jar/META-INF/ejb-jar.xml which is ignored.
So you have two options, either create a WebArchive with the EJBs in WEB-INF/classes:
ShrinkWrap.create(WebArchive.class, "test.war") .addClasses(CompositeQuery.class, CompositeQueryBean.class) .addAsWebInfResource("META-INF/ejb-jar.xml", "ejb-jar.xml")
or create a WebArchive with EJBs in a library in WEB-INF/lib and ejb-jar.xml in WEB-INF/
ShrinkWrap.create(WebArchive.class, "test.war") .addAsLibrary( ShrinkWrap.ctreate(JavaArchive.class, "test.jar") .addClasses(CompositeQuery.class, CompositeQueryBean.class) ) .addAsWebInfResource("META-INF/ejb-jar.xml", "ejb-jar.xml")
-
3. Re: ejb-jar.xml ignored by jbossas-remote-6?
aslak Sep 22, 2011 10:36 AM (in response to aslak)forgot to add, https://docs.jboss.org/author/display/ARQ/Servlet+3.0
-
4. Re: ejb-jar.xml ignored by jbossas-remote-6?
gunterze Sep 22, 2011 11:52 AM (in response to aslak)It works! Thanks!