0
votes

I try to create JPA persistency module and access it from OSGI WAB in glassfish 3.1. The way to do it in non-OSGI WAR is to copy the persistency jar into WAR.

However when I deploy the OSGI WAB with jpa jar, I get the exception:

[#|2011-02-01T18:29:10.035+0200|SEVERE|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=17;_ThreadName=Thread-1;|java.lang.RuntimeException: java.util.zip.ZipException: duplicate entry: META-INF/maven/com.test/test-web/pom.properties at org.glassfish.osgijavaeebase.OSGiBundleArchive$1.run(OSGiBundleArchive.java:366)

Should the JPA jar contain some special entries in a manifest? It must be defined as OSGI bundle? Please consult.

Update: The issues was resolved:

  1. To avoid ZipException, I removed the "." from Bundle-Classpath in bundle Manifest.
  2. To get more detailed logs with exceptions, I upgraded Glassfish 3.1 build to 41 (I was working with build 35).
  3. JPA with Hibernate inside bundle started to work after I fixed several classpath problems
1

1 Answers

0
votes

To use JPA in a WAB, you just have to drop the persistence jar containing entities and persistence.xml in WEB-INF/lib/ of your WAB. Tell us how the Bundle-ClassPath manifest entry in the WAB looks like. I don't watch this forum; I watch glassfish forum. Can you post your question at [email protected] if you want faster response?