Possible Duplicate:
Sharing a persistence unit across components in a .ear file
I have a project with JPA entities and a persistence.xml file. I packaged them into a jar file and deployed to an app server (JBoss 7.1).
I have another project, a web application, which has a session bean and I'd like to use this persistence unit there (by injection).
However I get an exception:
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011047: Component class com.mypackage.MyService for component MyService has errors:
JBAS011440: Can't find a persistence unit named my_pu in deployment "mywebapp.war"
I tried to add the jar of the PU as dependency in the manifest.mf of the war but without any success.
Do you know how to achieve this?