Thanks, it's parsing the files properly now.
Just need to get the hibernate link working now :)
OK, I've got it working in a single jar. But as I understand it, I can't reference the PersistenceUnit from one jar in an EJB to another. Is this correct?
This is my structure:
my-ear.ear ---persistence.jar ------META-INF/peristence.xml ---ejb.jar ------session-beans ---META-INF/application.xml
In my session beans i have
@PersistenceContext private EntityManager manager;
but I get an error about a default persistent unit not being defined. I've tried referencing the persistent unit by name - @PersistenceUnit( name="PersistenceHCE" ) - to no avail. The only way I can get it to work is to bind it the the global JNDI and perform a lookup. Is this right? All the tutorials I've found assume that everything is deployed in the same ear/jar
@PersistenceContext (unitName="persistence.jar#PersistenceHCE") private EntityManager manager;
Let us know how it goes.
Shiny, that worked. Many thanks for all your help.
I think I have the same problem as you described.
Maybe you can take a look at it: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=142387
If I understood you right you fixed your problem by using a jar with a persistence.xml?
But now I am a little bit confused, I thought the HAR should do this.
So what is the HAR good for?
All the best,
Arres, if you're trying to use the EJB3 style annotations you need to sue a jar with a persistence.xml file. I'm not sure how you go about using annotations in JBoss without using a persistence.xml
I find it much easier to use EJB3 instead of hibernate, the session management works much better. Have a look at this tutorial: http://www.laliluna.de/ejb-3-tutorial-jboss.html