When I try to create an EntityManager, I get this exception:
java.lang.SecurityException: class "javax.persistence.PersistenceUtil"'s signer information does not match signer information of other classes in the same package
Perhaps it is something with the javax.persistence packages but I don't know how can I fix it.
public static EntityManager getEntityManager() {
if(emf == null) {
emf = Persistence.createEntityManagerFactory("AccountsManager");
}
return emf.createEntityManager();
}
Here is the persistence.xml file
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="AccountsManager" transaction-
type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>model.Account</class>
<class>model.AllSubscription</class>
<class>model.Client</class>
</persistence-unit>
I found similar questions but I didn't find any solutions.