users@glassfish.java.net

Error deploing simplified WAR packaged with two ejb-jar modules

From: <forums_at_java.net>
Date: Thu, 22 Dec 2011 05:10:36 -0600 (CST)

I've got problem with simplified ejb jar packaging. I try to package two ejb
jars into WAR.
Each of ejb jars definies it's own persistance unit with separate set of ejb
classes.
WAR:
   WEB-INF
     |- lib
         |- a.jar
         |- b.jar
a.jar:
   META-INF
     |- beans.xml          (just root element in file)
     |- orm.xml            (version="1.0"   embaddable
classes defined)
     |- ejb-jar.xml        (version="3.0"   no beans defined)
     \- persistance.xml    (name="ipon")
b.jar:
   META-INF
     |- beans.xml          (just root element in file)
     |- orm.xml            (version="1.0"   embaddable
classes defined)
     |- ejb-jar.xml        (version="3.0"   no beans defined)
     \- persisntance.xml   (name="teryt")
While deployment on GF I got error message: "Could not resolve a persistence
unit" (see below stack trace)
The exception is thrown only when there are two persistance.xmls. If only one
ejb jar is packaged into WEB-INF/lib or if both jars are packaged but only
one of then has persistnace.xml the error does not appear.
*Is there restriction for Simplified packaging in GF that limits numer of ejb
jars that could be packaged into WAR?
*

*If that's not the case, where could be problem with in my packaging? *

*
*

OS:    WinXP SP3
Java:  1.6.0_26-b03
GF:    GlassFish Server Open Source Edition 3.0.1 (build 22)
[#|2011-12-22T10:45:46.156+0100|SEVERE|glassfish3.0.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=24;_ThreadName=Thread-1;|Exception
while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
java.lang.RuntimeException: Could not resolve a persistence unit
corresponding to the persistence-context-ref-name [ipon] in the scope of the
module called [ipon]. Please verify your application.
    at
com.sun.enterprise.deployment.BundleDescriptor.findReferencedPUsViaPCRefs(BundleDescriptor.java:672)
    at
com.sun.enterprise.deployment.WebBundleDescriptor.findReferencedPUs(WebBundleDescriptor.java:1038)
    at
org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:103)
    at
com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:644)
    at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:296)
    at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
    at
org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
    at
com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
    at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
    at
com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)


--
[Message sent by forum member 'aszwaj']
View Post: http://forums.java.net/node/876449