Question

When trying to run my program with Tomcat Apache, I get the following error:

SEVERE: Mapped exception to response: 500 (Internal Server Error) java.lang.SecurityException: class "javax.persistence.PersistenceUtil"'s signer information does not match signer information of other classes in the same package at java.lang.ClassLoader.checkCerts(ClassLoader.java:806) at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:625) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at org.odata4j.producer.jpa.JPAProducerFactory.create(JPAProducerFactory.java:32) at ......

Earlier I was getting a "java.lang.NoClassDefFoundError: javax/persistence/Persistence" error so I added the javax.persistence_2.0.5.v201212031355.jar to WEB-INF/lib.

My WEB-INF/lib looks like:

enter image description here

Was it helpful?

Solution 2

I resolved this error by removing BOTH eclipselink.jar and odata4j-core-0.7.0.jar

My WEB-INF/lib now looks like:

enter image description here

OTHER TIPS

I am using eclipselink version 2.7.4 and was getting the same error and to fix it I excluded javax.persistence and jakarta.persistence from eclipselink dependency.

Error:

java.lang.SecurityException: class "javax.persistence.PersistenceUtil"'s signer information does not match signer information of other classes in the same package

Fix:

<dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>eclipselink</artifactId>
    <version>2.7.4</version>
    <exclusions>
        <exclusion>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>jakarta.persistence</artifactId>
        </exclusion>
    </exclusions>
</dependency>

This pulls in eclipselink but excludes the javax.persistence dependency. Please refer this link for more detailed information. I hope this would help

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top