[Solved] Having trouble deplying EAR. Can't resolve persistence unit...
I'm having a problem that should be very easy to troubleshoot, but I just can't figure it out. I must be making a stupid mistake somewhere. I've tried setting the logging to finest for javax.enterprise.system.tools.deployment, but it doesn't seem to give me any extra info.
If someone can tell me how to get verbose logging when deploying an application I can figure this out on my own. If not, my configuration is below. Are there any obvious mistakes?
I have a a very simple EAR with the following structure:
<br /> assembly-ear-1.0-SNAPSHOT.ear<br /> -- /META-INF/*<br /> -- /lib/domain-1.0-SNAPSHOT.jar <<< POJO Module<br /> -- /lib/services-dao-api-1.0-SNAPSHOT.jar <<< POJO Module<br /> -- services-dao-1.0-SNAPSHOT.jar <<< EJB Module<br />
I have the following persistence.xml file in the META-INF directory of the domain-1.0-SNAPSHOT.jar module:
</p> <p> itma-ds</p> <p> org.eclipse.persistence.jpa.PersistenceProvider</p> <p> false</p> <p>
I try to inject the persistence unit in my EJB module like this (I've also tried it without giving a name):
<br /> @PersistenceUnit(name = "ItmaPU")<br /> private EntityManagerFactory emf;<br />
I let Maven generate my application.xml file. It looks like this:
<br /> <?xml version="1.0" encoding="UTF-8"?></p> <p> assembly-ejb</p> <p> services-dao-1.0-SNAPSHOT.jar</p> <p> /lib</p> <p>
I don't have an ejb-jar.xml file.
Whenever I deploy I get the error:
<br /> Could not resolve a persistence unit corresponding to the persistence-unit-ref-name<br /> [ItmaPU] in scope of the module called<br /> [assembly-ear-1.0-SNAPSHOT#services-dao-1.0-SNAPSHOT.jar]<br />
My data source appears to be named correctly:
<br /> ./asadmin list-jndi-entries<br /> ...<br /> itma-ds: org.glassfish.javaee.services.ResourceProxy<br />
I'm using Glassfish v3.1 built on April 16, 2010. I updated my config from something I used with Glassfish v2, so maybe I've overlooked something that changed between versions. I haven't added / removed any modules. My database connections are working.
Message was edited by: jptech