1 Reply Latest reply on Apr 14, 2006 12:22 PM by Stefan Craatz

    Newbiy deployment trouble

    Thomas Kratz Newbie

      I switched to 4.0.4R2 yesterday. Since then My Ejbs aren't discoreverd on deployment time.
      I have a simple EAR with application xml

      <?xml version="1.0" encoding="UTF-8"?>
      <application version="1.4"
       xmlns="http://java.sun.com/xml/ns/j2ee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
       http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
       <display-name>de.eiswind.paris.server</display-name>
       <module>
       <ejb>de.eiswind.paris.server.jar</ejb>
       </module>
       <module>
       <ejb>eiswind.paris.model.jar</ejb>
       </module>
      </application>
      


      and
      jboss-app.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-app>
       <loader-repository>
       de.eiswind.paris.server:app=ejb3
       </loader-repository>
      </jboss-app>
      


      in de.eiswind.paris.server.jar i put persistence.xml (since i need the persistence unit there, the entities are found in eiswind.paris.model.jar
      <?xml version="1.0" encoding="UTF-8"?>
      <persistence>
       <persistence-unit name="de.eiswind.paris.server">
       <jta-data-source>java:/DefaultDS</jta-data-source>
       <jar-file>../de.eiswind.paris.model.jar</jar-file>
       <class>eiswind.paris.model.Category</class>
       <properties>
       <property name="hibernate.show_sql" value="true" />
       <property name="hibernate.hbm2ddl.auto" value="create-drop" />
       </properties>
       </persistence-unit>
      </persistence>
      


      it simply does nothing on deployment
      18:44:49,991 INFO [EARDeployer] Init J2EE application: file:/home/thomas/bin/jboss-4.0.4.CR2/server/default/deploy/de.eiswind.paris.sever.ear
      18:44:50,098 INFO [EARDeployer] Started J2EE application: file:/home/thomas/bin/jboss-4.0.4.CR2/server/default/deploy/de.eiswind.paris.sever.ear
      


      thats all it says. i guess something changed in the persistence.xml syntax but i don't know where to find it. even the EJB3Trailblazer doesnt work on the new installation so have you any hints for me where to look for reliable resources ?

      So long Tom

        • 1. Re: Newbiy deployment trouble
          Stefan Craatz Newbie

          Tom,

          the format of the persistence.xml changed. The persistence unit is no longer automatically stored in JNDI. The following file works for me:

          <persistence>
           <persistence-unit name="WebappSample">
           <jta-data-source>java:jdbc/WebappSample</jta-data-source>
           <properties>
           <!-- Hibernate Properties -->
           <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
           <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
           <property name="hibernate.show_sql" value="true"/>
           <property name="jboss.entity.manager.factory.jndi.name" value="java:EntityManagerFactories/WebappSample"/>
           <property name="jboss.entity.manager.jndi.name" value="java:EntityManagers/WebappSample"/>
           </properties>
           </persistence-unit>
          </persistence>
          


          Somewhere in the EJB3 WIKI a description of all changes (Hibernate EntityManager) can be found. It is quite good hidden ;-) but you should take a look at it.

          hope that helps
          Stefan