[jboss-user] [JBoss Tools] - How to access entity jar created in eclipse jta project

Monty Hall do-not-reply at jboss.com
Mon Dec 26 16:09:20 EST 2011


Monty Hall [http://community.jboss.org/people/monty_hall] created the discussion

"How to access entity jar created in eclipse jta project"

To view the discussion, visit: http://community.jboss.org/message/643237#643237

--------------------------------------------------------------
New to jboss and created the following projects using jboss tools in eclipse.

Name                  Eclipse Project
----                  ---------------

EAR                   EAR Project
EJB1                  EJB Project
EJB2                  EJB Project
PERSISTENCE           JPA Project
   META-INF\persistence.xml - persistence unit name = "PERSISTENCE"

WEB                   Dynamic Web Project


I would like for beans in EJB1, EJB2, and WEB projects to be able to access entities defined in PERSISTENCE JPA projects.  How can I do this?
In my beans, I've tried injecting like:

@PersistenceContext
@PersistenceContext(unitName="PERSISTENCE")
@PersistenceContext(unitName="PERSISTENCE.jar#PERSISTENCE")
@PersistenceContext(unitName="../PERSISTENCE.jar#PERSISTENCE")

I've tried swapping # w/ !, but no luck still.

Any help appreciated.

Monty

-------------------------------------------
The persistence.xml in the PERSISTENCE project is:


<?xml version="1.0" encoding="UTF-8"?>
<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/persistencehttp://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
          <persistence-unit name="PERSISTENCE">
                    <jta-data-source>java:jboss/datasources/xxxx</jta-data-source>
                    <exclude-unlisted-classes>false</exclude-unlisted-classes>
          </persistence-unit>
</persistence>
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/643237#643237]

Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2128]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111226/31453453/attachment.html 


More information about the jboss-user mailing list