java - "Entity name must be unique in a persistence unit" -
i'm new glassfish server , i'm experiencing problem. first imported template project (that uses jpa) netbeans, working fine. then, since wanted modify template, created copy of project, closed original 1 in netbeans, undeployed first project , imported new copied project netbeans. changed package name , name of persistence unit. when try run new project error
entity name must unique in persistence unit. entity name [todoitem] used entity classes [package1.todoitem] , [package2.todoitem]
how possible? original project no longer exists in netbeans, explicitly undeployed glassfish using asadmin undeploy command, , tried remove , reinstall glassfish, nothing changes.
my persistence.xml looks this:
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="myserver-unit" transaction-type="jta"> <jta-data-source/> <properties> <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/> <property name="javax.persistence.schema-generation.create-source" value="metadata-then-script"/> <property name="javax.persistence.schema-generation.drop-source" value="metadata-then-script"/> <property name="javax.persistence.schema-generation.create-script-source" value="create-script.sql"/> <property name="javax.persistence.schema-generation.drop-script-source" value="drop-script.sql"/> <property name="javax.persistence.sql-load-script-source" value="load-script.sql"/> <property name="eclipselink.logging.level" value="finest"/> </properties>
the thing changed name of persistence unit.
this happened me , worked me clean project , removing osgi-cache directory in domain folder; seems built packages stay in cache , cause naming conflicts.
edit: bit of clarification, managed same error on clean install of glassfish because had old .class files in project though source didn't exist , ended on clean domain anyway.
Comments
Post a Comment