[jboss-user] [EJB/JBoss] - How do I use the same JPA entities in multiple applications?

krenfro do-not-reply at jboss.com
Thu Jul 17 15:19:27 EDT 2008


JBoss 4.2.2

I have some JPA entities packaged in User-entity.jar with a persistence context named 'UserPU'.  I include this User-entity.jar in an ejb.jar and deploy it.  This works great and I can CRUD entities.  Now I want to include the User-entity.jar in a separate application (ear or ejb-jar) and when deployed I get the following WARNING:

13:29:37,778 WARN  [ServiceController] Problem starting service jboss.j2ee:module=User-entity-0.1-test.jar,uid=1243449447,service=EJB3
  | java.lang.RuntimeException: javax.management.InstanceAlreadyExistsException: persistence.units:unitName=UserPU already registered.
  | 

Is it possible to reuse JPA entities in this way? Is it recommended? 

thanks!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165178#4165178

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165178



More information about the jboss-user mailing list