0 Replies Latest reply on Mar 6, 2007 2:25 AM by Steve Dobson

    Problem with persistance using JBossAS 5.0.4 & MySQL5

    Steve Dobson Newbie

      I installed JbossAS using the JEMS installer (on my Linux box - no poblem) Selected for EJB3 and default.

      Downloaded the jboss-seam-1.2.0-PATCH1 tarball and compiled and ran the seam-booking example. No problem.

      Change the JBossAS configuration to remove HSQLDS and replace it with a MySQL5 database interface so it would be production ready. Made minimal modifications to seam-booking for the new MySQL set up and that works just fine. No errors seams useable (pardon the pun :-).

      Started work on my project using the seam-booking configuration as my starting point. the JSP/Seam works just fine. Used the Register, RegisterAction and User classes from seam-booking as the starting point for my own login/security model. My problem is that the user table is not created in my MySQL database unlike the seam-booking example.

      I get the following error:

      ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      
      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:ear=league.ear,jar=league.jar,name=RegisterAction,service=EJB3
       State: NOTYETINSTALLED
       I Depend On:
       persistence.units:unitName=leagueDS
      
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:unitName=leagueDS
       State: NOTYETINSTALLED
       Depends On Me:
       jboss.j2ee:ear=league.ear,jar=league.jar,name=RegisterAction,service=EJB3
      


      Obviously I've made a small conf error in my project, but I can't see it for looking. This is a difference between the seam-booking EAR config and myown:

      diff -u -r resources/META-INF/application.xml /home/steve/jLeague/config/ear/application.xml
      --- resources/META-INF/application.xml 2007-03-05 07:31:39.647850553 +0000
      +++ /home/steve/jLeague/config/ear/application.xml 2007-03-05 09:52:02.766262553 +0000
      @@ -4,25 +4,23 @@
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
       version="5">
      
      - <display-name>Seam Booking</display-name>
      + <display-name>Leagues</display-name>
      
       <module>
       <web>
      - <web-uri>jboss-seam-booking.war</web-uri>
      - <context-root>/league</context-root>
      + <web-uri>league.war</web-uri>
      + <context-root>/</context-root>
       </web>
       </module>
      
       <module>
      - <ejb>jboss-seam-booking.jar</ejb>
      + <ejb>league.jar</ejb>
       </module>
      
       <module>
       <java>jboss-seam.jar</java>
       </module>
      
      - <!-- Remove these lines for JSF 1.2 -->
      -
       <module>
       <java>el-api.jar</java>
       </module>
      Only in /home/steve/jLeague/config/ear/: CVS
      diff -u -r resources/META-INF/jboss-app.xml /home/steve/jLeague/config/ear/jboss-app.xml
      --- resources/META-INF/jboss-app.xml 2007-03-05 07:31:20.766670553 +0000
      +++ /home/steve/jLeague/config/ear/jboss-app.xml 2007-03-05 06:33:56.575422053 +0000
      @@ -1,5 +1,5 @@
       <jboss-app>
      - <loader-repository>
      - seam.jboss.org:loader=league
      - </loader-repository>
      + <loader-repository>
      + seam.jboss.org:loader=league
      + </loader-repository>
       </jboss-app>
      diff -u -r resources/META-INF/jboss-beans.xml /home/steve/jLeague/config/ear/jboss-beans.xml
      --- resources/META-INF/jboss-beans.xml 2007-03-03 09:04:41.418257510 +0000
      +++ /home/steve/jLeague/config/ear/jboss-beans.xml 2007-03-06 00:40:30.173767303 +0000
      @@ -4,11 +4,12 @@
       xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
       xmlns="urn:jboss:bean-deployer">
      
      - <bean name="bookingDatasourceBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
      + <bean name="leagueDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
       <property name="driverClass">org.mysql.jdbc.Driver</property>
      - <property name="connectionURL">jdbc:hsqldb:.</property>
      - <property name="userName">sa</property>
      - <property name="jndiName">java:/bookingDatasource</property>
      + <property name="connectionURL">jdbc:mysql://localhost:3306/league</property>
      + <property name="userName">league</property>
      + <property name="password">NOTSAYING</property>
      + <property name="jndiName">java:/leagueDS</property>
       <property name="minSize">0</property>
       <property name="maxSize">10</property>
       <property name="blockingTimeout">1000</property>
      @@ -18,9 +19,9 @@
       <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
       </bean>
      
      - <bean name="bookingDatasource" class="java.lang.Object">
      + <bean name="leagueDS" class="java.lang.Object">
       <constructor factoryMethod="getDatasource">
      - <factory bean="bookingDatasourceBootstrap"/>
      + <factory bean="leagueDSBootstrap"/>
       </constructor>
       </bean>
      
      diff -u -r resources/META-INF/persistence.xml /home/steve/jLeague/config/ear/persistence.xml
      --- resources/META-INF/persistence.xml 2007-03-05 07:28:52.697416803 +0000
      +++ /home/steve/jLeague/config/ear/persistence.xml 2007-03-06 00:56:16.688920803 +0000
      @@ -3,15 +3,13 @@
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
       version="1.0">
      - <persistence-unit name="bookingDatabase">
      - <provider>org.hibernate.ejb.HibernatePersistence</provider>
      - <jta-data-source>java:/leagueDS</jta-data-source>
      - <properties>
      - <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
      - <!-- property name="hibernate.show_sql" value="true"/ -->
      - <!-- These are the default for JBoss EJB3, but not for HEM: -->
      - <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
      - <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
      - </properties>
      - </persistence-unit>
      +
      + <persistence-unit name="test">
      + <jta-data-source>java:/leagueDS</jta-data-source>
      + <properties>
      + <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
      + <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
      + <!-- property name="hibernate.hbm2ddl.auto" value="update"/ -->
      + </properties>
      + </persistence-unit>
       </persistence>