i have enterprise application project with 4 modules. it is deploy on WLS 10.3.4. i'm using eclipse helios for development with oracle web tools for eclipse. local WLS on my machine is installed as develpment mode.

structure of project is like this:

xxx_EAR
|-> xxx_JPA
|-> xxx_EJB
|-> xxx_EJBClient
|-> xxx_WEB

common jars, that is used accross modules are in xxx_EAR/APP-INF/lib

inside xxx_JPA is persistence.xml with three persistence-units, and in xxx_EJB are classes, beans, that uses @PersistentContext to reference on them.

EJB version is 3.0
JPA is 1.0 (Eclipselink 1.1.x)

and everything works fine locally on my copmputer. when i try to deploy EAR file on test WLS i'm getting following exception

Unable to deploy EJB: XxxFacadeImpl from xxx_EJB.jar:

No persistence unit named 'xxx_EJB' is available in scope xxx_EJB.jar. Available persistence units: []
    at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:469)
    at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:518)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)

...

only difference, as i see, between servers is in installation mode, test WLS is installed as Production Mode.

do you have any hint?

thanks in advance!!

2

There are 2 best solutions below

1
On

Are the server's the same versions? What happens if you put everything in the JPA jar in the EJB jar, does it work then?

0
On

I had the same error but in reverse. I can deploy the EAR to a production or deploy from the WebLogic console just fine but I can't deploy locally via the Eclipse Weblogic plugin. What had worked for me was changing version of the javax.persistence_xxx.jar in the build path of the EJB project.

In my case I change from javax.persistence_1.xxx to javax.persistence_2.xxx.

Hope this helps somebody. In my search for a solution to this problem, the link below from coderance also had help me.

http://www.coderanch.com/t/578851/EJB-JEE/java/persistence-unit-named-scope-BL