[jboss-user] newbie question: jpa and ejb - no default PersistenceUnit
tamas.rev at gmail.com
Fri Nov 12 06:49:27 EST 2010
Thank you for your reply and letting me know about the jboss forums.
Fortunately, I could make the thing work: I had to place the persistence
an ejb-jar, and add a jta datasource to the persistence.xml. Someday I'll
again with separate jars.
On Thu, Nov 11, 2010 at 4:49 PM, Stephen Davidson <gorky at freenet.carleton.ca
> While there is a way to get this to work, I do apologize for not knowing
> it offhand. And unfortunately, this mailing list is no longer monitored
> by anyone from the JBoss Group.
> Feel free to try the Forums.
> On 11/10/2010 05:30 AM, REV Tamas wrote:
> > Hi,
> > I'm new to JBoss and Eclipse. I've been using NetBeans and GlassFish for
> > Java EE development.
> > Now I'm working on a very simple PoC just to see how I can use these
> > technologies. I have a very simple
> > JPA project. It contains a persistence xml and a few entities, inherited
> > from each other.
> > persistence.xml excrept:
> > <persistence version="1.0" ...>
> > <persistence-unit name="HotelPoi" transaction-type="JTA">
> > ...
> > </persistence-unit>
> > </persistence>
> > I have an EJB project too, it contains a stateless session bean. The
> > bean injects a persistence unit this way:
> > @PersistenceUnit(name="HotelPoi")
> > EntityManager em;
> > I receive the following deploy-time exception:
> > 2010-11-10 12:19:51,656 DEBUG [org.jboss.ejb3.Ejb3Module] Starting
> > failed jboss.j2ee:service=EJB3,module=HotelPoiFinder.jar
> > java.lang.RuntimeException: Illegal @PersistenceUnit on
> > javax.persistence.EntityManager com.edreams.poi.finder.PoiFinder.em
> > :There is no default persistence unit in this deployment.
> > at
> > at
> > at
> > I double-checked the ear and it contains the JpaProject in the lib
> > directory. I placed it in the root dir too and receive the same
> > I'm using JBoss 4.2.3.GA <http://4.2.3.GA> and Eclipse with the
> > following build id: 20100617-1415
> > Do you have any ideas how to make this injection work?
> > Best Regards,
> > Tamas
> > _______________________________________________
> > jboss-user mailing list
> > jboss-user at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/jboss-user
> jboss-user mailing list
> jboss-user at lists.jboss.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jboss-user