I'm having a few issues getting .par files to work inside Tomcat 5.5.9. I'm wondering what the recommended way of packaging up annotated classes is for use with Tomcat. I found that if I put them in a .par file, I receive a NoClassDefFoundError. Note, I'm putting the .par file in my WEB-INF/lib directory along with the main .jar file for my application. I'm guessing that this is because Tomcat only knows to look in files with a .jar extension. Note, if I test my .par with a standalone application and just include the .par in my classpath everything works fine. The class listed below is a class annotated with @Entity which is in my .par.
Code:
javax.faces.el.EvaluationException: java.lang.NoClassDefFoundError: edu/uchicago/at/alt/persistence/entity/Application
I can get it to work if I simply put all the files including the META-INF/persistence.xml file in my main .jar file. However, I still receive an exception like the following (but it works).
Code:
WARNING: Unable to find file (ignored): opt/jakarta-tomcat-5.5.9-dev/webapps/alt/WEB-INF/lib/alt.jar
java.util.zip.ZipException: No such file or directory
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.hibernate.ejb.packaging.ZippedJarVisitor.doProcessElements(ZippedJarVisitor.java:29)
at org.hibernate.ejb.packaging.JarVisitor.getClassNames(JarVisitor.java:79)
at org.hibernate.ejb.HibernatePersistence.addMetadataFromVisitor(HibernatePersistence.java:216)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:185)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at edu.uchicago.at.alt.persistence.EntityManagerManager.getEntityManagerFactory(EntityManagerManager.java:89)
Hibernate version: hibernate-3.1beta1, hibernate-entitymanager-3.1beta2
Has anyone else ran into this or know what I might be doing wrong?