[jboss-user] [EJB 3.0] - Persistence Unit NOTYETINSTALLED

Ganton do-not-reply at jboss.com
Wed Oct 18 01:23:04 EDT 2006


I am trying to learn EJB3 on 4.0.4GA-Patch1, and am having trouble with my persistence unit.

The whole application is packaged in an EAR, with the entity beans in one jar, the session beans in another jar, and the web-app in a war.

The persistence.xml is packaged in the META-INF directory of the jar containing the entity beans.

I am trying a dependency injection on a stateless session bean, with the following code:

@PersistenceContext(unitName="users")
  |   protected EntityManager em;

with the following persistence.xml


  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <persistence>
  |     <persistence-unit name="users">
  |       <jta-data-source>java:/usersDS</jta-data-source>
  |       <properties>
  |          <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
  |       </properties>
  |     </persistence-unit>
  | </persistence>
  | 

and I get the following errors during deployment:

--- MBeans waiting for other MBeans ---
  | ObjectName: jboss.j2ee:ear=users.ear,jar=business.jar,name=UserManagerBean,ser
  | vice=EJB3
  |   State: NOTYETINSTALLED
  |   I Depend On:
  |     persistence.units:unitName=users
  | 
  | --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
  | ObjectName: persistence.units:unitName=users
  |   State: NOTYETINSTALLED
  |   Depends On Me:
  |     jboss.j2ee:ear=forums.ear,jar=business.jar,name=UserManagerBean,service=EJB3
  | 
  | 

Anybody know why the persistence unit isn't being registered, or if that is in fact the problem ?

Thanks in advance for help



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

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



More information about the jboss-user mailing list