7 Replies Latest reply on Sep 5, 2013 5:19 AM by pj.prashant

    Persistence Unit NOTYETINSTALLED

      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



        • 1. Re: Persistence Unit NOTYETINSTALLED

          I figured this out, my DD for persistence.xml was not named correctly.

          • 2. Re: Persistence Unit NOTYETINSTALLED
            mludlum

            Ganton,

            I'm having this same problem. Can you elaborate on your solution? What do you mean by DD? Data Dictionary?

            • 3. Re: Persistence Unit NOTYETINSTALLED
              jasonshaffer

              I am also experiencing this exact problem and have been searching for two days straight with no resolve. Please help!

              • 4. Re: Persistence Unit NOTYETINSTALLED
                straiver

                I have troubles with Persistence unit too:

                --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                ObjectName: jboss.jca:service=DataSourceBinding,name=DefaultDS
                State: NOTYETINSTALLED
                Depends On Me:
                jboss.ejb:service=EJBTimerService,persistencePolicy=database
                jboss.mq:service=StateManager
                jboss.mq:service=PersistenceManager
                
                ObjectName: persistence.units:jar=ru.srpu.jtest.dao.jar,unitName=jtests
                State: FAILED
                Reason: org.hibernate.MappingException: Unable to find column with logical name: id in org.hibernate.mapping.Table(Test) and its related supertables and secondary tables
                I Depend On:
                jboss.jca:service=ManagedConnectionFactory,name=MySqlDS
                Depends On Me:
                jboss.j2ee:jar=ru.srpu.jtest.dao.jar,name=UserBean,service=EJB3



                • 5. Re: Persistence Unit NOTYETINSTALLED
                  diablo341

                  I had a similar problem. Make sure your datasource.xml file that defines your connection is in the server/default/deploy directory.

                  • 6. Re: Persistence Unit NOTYETINSTALLED
                    dilator

                    I found that if in my persistence.xml I had the jta-data-source set as java:/xyz then then in the datasource.xml the jndi-name needed to be just xyz on its own

                    • 7. Re: Persistence Unit NOTYETINSTALLED
                      pj.prashant

                      When we apply tow injection on the same class in One web application like

                      1) EJB injection by @stateless

                      2) and Hibernet injection by  @PersistenceContext

                       

                      Its ok and working fine

                      but like this way if you have two project in jboss (C:\jboss-4.2.3.GA\server\default\deploy) and both the project have the Object have the above things

                      It gives message

                       

                      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---

                      ObjectName: persistence.units:unitName=hdgPersistCtxUnitName

                        State: NOTYETINSTALLED

                        Depends On Me:

                          jboss.j2ee:ear=appOne.ear,jar=EOne.jar,name=CPProcess,service=EJB3

                       

                      My single web application is working but as soon I deploy the second web application it show me the error.

                       

                      I think that when a global PersistCtx will also load both object (web app1 and web app2) now when web app2 is loaded EJB injection can't be apply and wail for release of MBEANS from hibernet.

                       

                      My web app2 is a copy of we app1 but I seperate the context, database, hibernet perstence context name, mssqlApp1-ds.xml and mssqlApp2-ds.xml

                      I found no issue with the Object have only  @PersistenceContext but not @stateless

                      or @stateless but not @PersistenceContext

                       

                      Anyhow this is unsolved issue for me.