[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Re: JBoss 4.2.0, hibernate annotations being picked up

pixel do-not-reply at jboss.com
Mon Mar 10 11:41:51 EDT 2008


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

Thanks

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

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



More information about the jboss-user mailing list