Hi All,
Good day and hope someone can help me here!
When I deploy to GlassFish I see the following error:
Entity name must be unique in a persistence unit. Entity name [bean-classname] is used for the entity classes [com.old-package-path.bean-classname] and [com.new-package-path.bean-classname]
What I did was that I just changed the package path of all my classes in my Java EJB project. i.e.
- I changed the package declaration in every glass
- I updated the directory structure accordingly
- I changed the groupId property in pom.xml
- I changed the class property in persistence.xml
After these changes, all occurrences of my previous package path "com.old-package-path" should be gone. However during deployment that old path still keeps coming up in error.
I tried restarting GlassFish and MySQL server as well... still giving me the same error.
I suppose EclipseLink "remembers" that my Entity Bean is mapped to my class with the old package path, therefore complaining when it's mapped to a new one. But where is that saved and how can I clear it?
Any help appreciated thank you!!
Daniel