users@glassfish.java.net

EAR fails to deploy when moving to V3 - strange PU error

From: <glassfish_at_javadesktop.org>
Date: Fri, 20 Aug 2010 06:14:58 PDT

I have problems migrating my EJB3/JPA-based webapp to Glassfish V3.

First, I had to restructure my EAR. It appears that V2 was a bit permissive on where JARs could be. Now they need to be in /lib. No problem, my new configuation is

+ foo.war
+ foo-ejb.jar
+ lib/utils.jar
+ lib/foo-entities.jar

Where foo-entities.jar contains the entity classes and meta-inf/persistence.xml, which contains

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
   <persistence-unit name ="pu1">
      <jta-data-source>jdbc/fpdb</jta-data-source>
   </persistence-unit>
</persistence>

But my EAR still won't deploy. Now I get a very strange message in server.log, repeated 4 times. See below. I have been unable to figure out what to do about it. What's wrong?



[#|2010-08-20T14:17:04.953+0200|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
javax.persistence.PersistenceException: Exception [EclipseLink-28017] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Unable to predeploy PersistenceUnit [pu1] in invalid state [DeployFailed]
        at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:823)
        at org.eclipse.persistence.jpa.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:219)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.loadPU(PersistenceUnitLoader.java:181)
        at org.glassfish.persistence.jpa.PersistenceUnitLoader.<init>(PersistenceUnitLoader.java:96)
        at org.glassfish.persistence.jpa.JPADeployer.prepare(JPADeployer.java:121)
        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:310)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
        at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
        at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:141)
        at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:573)
        at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:459)
        at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:391)
        at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:376)
        at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:195)
        at java.util.TimerThread.mainLoop(Timer.java:512)
        at java.util.TimerThread.run(Timer.java:462)
Caused by: Exception [EclipseLink-28017] (Eclipse Persistence Services - 2.0.1.v20100213-r6600): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Unable to predeploy PersistenceUnit [pu1] in invalid state [DeployFailed]
        at org.eclipse.persistence.exceptions.EntityManagerSetupException.cannotPredeploy(EntityManagerSetupException.java:202)
        ... 22 more
|#]
[Message sent by forum member 'tmpsa']

http://forums.java.net/jive/thread.jspa?messageID=480673