Search code examples
javaeclipselinkjpa

eclipseLink 2.7.0: Static weaving error for "javax.persistence.AttributeConverter"'s signer information does not match


On running gradle task for static weaving in eclipseLink 2.7.0 getting below error.

21:50:14.206 [ERROR] [system.err] Exception Description: Predeployment of PersistenceUnit [default] failed.
21:50:14.206 [ERROR] [system.err] Internal Exception: java.lang.SecurityException: class "javax.persistence.AttributeConverter"'s signer information does not match signer info rmation of other classes in the same package
21:50:14.206 [ERROR] [system.err] at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.createPredeployFailedPersistenceException(EntityManagerSetupImpl.java:20 80)
21:50:14.206 [ERROR] [system.err] at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:2071)
21:50:14.206 [ERROR] [system.err] Exception Description: Predeployment of PersistenceUnit [default] failed.
21:50:14.206 [ERROR] [system.err] Internal Exception: java.lang.SecurityException: class "javax.persistence.AttributeConverter"'s signer information does not match signer info rmation of other classes in the same package

I am aware that these conflicts comes when class is referred by different jars.
Checked on the same lines.AttributeConverter is present in javax.persistence 2.2.0 as well as eclipselink 2.7.0 causing the conflict. javax.persistence 2.2.0 is required dependency for eclipselink 2.7.0.
I am gussesing have to exclude one of the jar so that AttributeConverter can be referred from 1 jar.But not sure how.

Any thoughts on resolving this issue ?


Solution

  • Issue seems to be with signing of the jars. eclipselink 2.7.0 uses javax persistence 2.2.0 which is signed by eclipse foundation where as eclipselink 2.7.0 is not. AttributeConverter in my case was refered and there was a signature mismatch. Issue 525457 was already filed with eclipse.org
    Using javax.persistence 2.1 resolved the issue.