I want to share an entity model, annotated with JPA, over a several JEE6 WEB projects. The entities are annotated like this:
@Entity
public class Contract implements Serializable {
I created a maven project with only annotated entity classes, the entity project.
In the client JEE6 WEB project I created a dependency on this entity project. The JEE6 project is able to compile, but when executing on a Glassfish application server there is a runtime error. The class is not recognized as a Entity class.
Caused by: java.lang.IllegalArgumentException: Object: nl.marcenschede.modules.Contract[ id=null ] is not a known entity type.
What to do for an imported class to be recognized as an entity project?
Have a look here for working example of how to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With