4 Replies Latest reply on Feb 19, 2006 5:27 PM by Peter Russell

    persistence.xml in EJB3.0 RC4

    Okanovi? Du?an Newbie

      There are no errors reported, but my .ejb3 fails to deploy under RC4. It worked under RC3.
      I changed class path in JBossIDE project, so no errors are reported.
      This is my persistence.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <entity-manager name="okiUnit">
       <jta-data-source>java:/MySqlDS</jta-data-source>
       <jar-file>SCMEJB.ejb3</jar-file>
       <properties>
       <property name="hibernate.dialect"
       value="org.hibernate.dialect.MySQLDialect" />
       <property name="hibernate.hbm2ddl.auto" value="update" />
       <property name="jboss.entity.manager.jndi.name" value="java:/okiManager"/>
       </properties>
      </entity-manager>
      


      It is as if deployer finds no entity beans and as if it doesn't look at persistence.xml.
      EntityManager cannot be found via JNDI.

      There are also some SLSB in the project. They fail to deploy because of:

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:unitName=okiManager
       State: NOTYETINSTALLED
       Depends On Me:
       jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=ApplicationFacadeBean
       jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=CityFacadeBean
       jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=EditionAnnotationFacadeBean
       jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=EditionFacadeBean
       jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=OrganisationFacadeBean
       jboss.j2ee:service=EJB3,jar=SCMEJB.ejb3,name=VersionFacadeBean
      


        • 1. Re: persistence.xml in EJB3.0 RC4
          Nikolaus Gerstmayr Newbie

          Sorry, no clue, just experienced a similar problem with RC4 :(

          got the trailblazer jboss-ide demo working under RC3.
          Fails with RC4.

          persistence.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <persistence xmlns="http://java.sun.com/xml/ns/persistence"/>
          <entity-manager>
           <name>it</name>
           <provider>org.hibernate.ejb.HibernatePersistence</provider>
           <jta-data-source>java:/MySqlDS</jta-data-source>
           <properties>
           <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>
           <property name="hibernate.hbm2ddl.auto" value="update"/>
           <property name="hibernate.show_sql" value="false"/>
           </properties>
          </entity-manager>
          


          
          --- MBeans waiting for other MBeans ---
          ObjectName: jboss.j2ee:service=EJB3,jar=authors-beans.ejb3,name=AuthorsBean
           State: NOTYETINSTALLED
           I Depend On:
           persistence.units:unitName=it
          
          --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
          ObjectName: persistence.units:unitName=it
           State: NOTYETINSTALLED
           Depends On Me:
           jboss.j2ee:service=EJB3,jar=authors-beans.ejb3,name=AuthorsBean
          


          no errors reported, "just" doesnt deploy anymore ...

          there is some vague / not really helpful hint at the FromJBossEJB3.0RC3ToRC4PFD wiki ->
          The persistence.xml schema has changed in the specification.
          See the tutorials or the spec for more details.
          but couldnt find out what actually changed.
          sorry for my stupidity if this is obvious :/


          • 2. Re: persistence.xml in EJB3.0 RC4
            J-C jc Apprentice

            It seems that peristence.xml xsd has changed, in demo, it looks like:

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


            I do not know if both syntax are supported !

            • 3. Re: persistence.xml in EJB3.0 RC4
              Nikolaus Gerstmayr Newbie


              Bingo :-)

              Thx a lot jc7442, changing persistence.xml fixed the deplyoment problems.

              now I'm getting problems with lookup, but that's a differnt story, need to look into this later ...