-
1. Re: ejb-jar.xml for ejb3.1
aslak Mar 22, 2012 7:57 AM (in response to armorer)What do you mean Arquillian generates a 2.1 ejb-jar xml ?
-
2. Re: ejb-jar.xml for ejb3.1
armorer Mar 22, 2012 8:09 AM (in response to aslak)for my jar I'm adding ejb-jar.xml next way:
.addAsManifestResource("META-INF/ejb-jar.xml", ArchivePaths.create("ejb-jar.xml"))
but there is no real ejb-jar.xml file in META-INF of my project
After deployment (it was successful) in _DEFAULT___DEFAULT__AppTest.ear in my jar's META-INF folder I have ejb-jar.xml:
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" version="2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>MEJB JAR</display-name>
<enterprise-beans>
<session>
<display-name>MEJBBean</display-name>
<ejb-name>MEJBBean</ejb-name>
<home>javax.management.j2ee.ManagementHome</home>
<remote>javax.management.j2ee.Management</remote>
<ejb-class>org.glassfish.admin.mejb.MEJBBean</ejb-class>
......
</ejb-jar>
-
3. Re: ejb-jar.xml for ejb3.1
armorer Mar 22, 2012 11:24 AM (in response to armorer)Added (attachment) test application to find out problem faster.
Just
mvn clean install
and ejb-jar.xml in App-ejb.jar will appear
My root problem: successfully deploy arquillian with ejb-jar.xml for EJB3.1 or to generate it on the fly. If I add blank ejb-jar.xml fro EJB3.1 (only <display-name>) - deploy is failed.
p.s.: sorry if my explanations were not clear
-
4. Re: ejb-jar.xml for ejb3.1
aslak Mar 22, 2012 12:10 PM (in response to armorer)1 of 1 people found this helpfulAa, I see..
when you do addAsManifestResource("META-INF/ejb-jar.xml", ....) ShrinkWrap will look for a META-INF/ejb-jar.xml on ClassPath. You don't have one in your project, but org.glassfish.extras:glassfish-embedded-all has one, which is the one you see in your deployment.
For EJB 3.1 you don't need a ejb-jar.xml, so simply don't add it. If you do have a ejb-jar.xml for your ejb that you want to use, you should be able to workaround this by not adding it as a Classpath Resource, but as a File resource, or as a String (if you create it)
addAsManifestResource(new File("src/main/resources/my-ejb.jar.xml"), "ejb-jar.xml")
or
addAsManifestResource(new StringAsset("<xml .............>"), "ejb-jar.xml")
-
5. Re: ejb-jar.xml for ejb3.1
armorer Mar 23, 2012 5:51 AM (in response to aslak)Thank for reply!
But my root problem is not fixed:
gets exception when I'm tring to deploy with next ejb-jar.xml file:
<?xml version="1.0" encoding="UTF-8"?> <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" version="3.1"> <display-name>TestApp-ejb</display-name> </ejb-jar>
exception:
SEVERE: Exception while loading the app : WELD-001408 Unsatisfied dependencies for type ...
* Maybe problem is with alternative stateless beans? It is successfully deployed with "generated" (from glassfish-embedded-all.jar) ejb-jar.xml and failed to deploy with my ejb-jar for ejb3.1
* Without ejb-jar.xml I can't deploy either.
* Tried to deploy with ejb-jar for v3.1 with GlassFish AS: success
Any ideas? Thanks for help!
-
6. Re: ejb-jar.xml for ejb3.1
armorer Mar 26, 2012 6:54 AM (in response to armorer)Nobody can help with this problem? Or maybe someone has working example for: cdi alternatives + ejb3.1 + arquillian.