7 Replies Latest reply on Mar 22, 2002 3:25 AM by houstonbernie

    Can't deploy CMP entity beans with JBoss 3 beta (CVS) and my

    houstonbernie

      Hi,

      I downed JBoss beta from CVS yesterday, got it built and up and running. It even deployed my mySQL datasource; only the syntax of mysql-service.xml had to be changed a little. (I had used the JBoss 3 alpha from jboss.org before, and all worked fine and I also deploying CMP entity beans worked like a charm).

      Now when I try to deploy the jar file with my CMP entity beans (which worked before - and remember, the datasource is deployed) I get the following exception stacktrace:
      (PartnerJur is the first CMP entity bean)

      2002-03-20 14:56:40,297 INFO [org.jboss.ejb.EjbModule] Deploying BenutzerSession
      2002-03-20 14:56:40,587 INFO [org.jboss.ejb.EjbModule] Deploying PartnerFacade
      2002-03-20 14:56:40,728 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.PartnerJur] Initializing CMP plugin for PartnerJur
      2002-03-20 14:56:41,168 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.PartnerJur] Loading standardjbosscmp-jdbc.xml : file:/C:/Programme/GNU/WinCvs/jboss-all/build/output/jboss-3.0.0beta2/server/default/conf/standardjbosscmp-jdbc.xml
      2002-03-20 14:56:41,609 ERROR [org.jboss.ejb.EntityContainer] Exception in service lifecyle operation: create
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCTypeFactory.createTypeSimple(JDBCTypeFactory.java:113)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCTypeFactory.getJDBCType(JDBCTypeFactory.java:75)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.(JDBCAbstractCMPFieldBridge.java:55)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCCMP2xFieldBridge.(JDBCCMP2xFieldBridge.java:43)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.createCMPField(JDBCEntityBridge.java:274)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.loadCMPFields(JDBCEntityBridge.java:141)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCEntityBridge.java:101)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.create(JDBCStoreManager.java:276)
      at org.jboss.ejb.plugins.CMPPersistenceManager.create(CMPPersistenceManager.java:138)
      at org.jboss.ejb.EntityContainer.create(EntityContainer.java:329)
      at org.jboss.ejb.Container.invoke(Container.java:765)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1003)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
      at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:745)
      ...

      How come? Are there any significant changes in any of the (CMP specific) config files that I should be aware of? Like in jboss-service.xml... do I have to put anything else into it? If this is of help: I tried putting the following line in my jboss-service.xml:


      org.gjt.mm.mysql.Driver


      This worked before with JBoss alpha, but now if I put it in JBoss doesn't even start up.

      Thanks! Any answer will be greatly appreciated!
      Bernhard

        • 1. Re: Can't deploy CMP entity beans with JBoss 3 beta (CVS) an
          houstonbernie

          Please, can anybody from the JBoss team maybe shed some light on this?

          • 2. Re: Can't deploy CMP entity beans with JBoss 3 beta (CVS) an
            pazu

            Have you modified standardjbosscmp-jdbc.xml in any way? If not, it seems there is a bug in MySQL typemappings.

            • 3. Re: Can't deploy CMP entity beans with JBoss 3 beta (CVS) an
              houstonbernie

              I commented out the standard defaults section and put in the following instead:

              java:/MySQLDS
              <type-mapping>mySQL</type-mapping>
              true
              <create-table>true</create-table>
              <remove-table>true</remove-table>
              <read-only>false</read-only>
              <time-out>300</time-out>
              <select-for-update>false</select-for-update>
              <preferred-relation-mapping>foreign-key</preferred-relation-mapping>


              This worked before making sure, java:/MySQLDS is my default datasource.

              • 4. Re: Can't deploy CMP entity beans with JBoss 3 beta (CVS) an
                houstonbernie

                I changed the defaults section standardjbosscmp-jdbc to the new standard:


                java:/MySQLDS
                <datasource-mapping>mySQL</datasource-mapping>
                <create-table>true</create-table>
                <remove-table>true</remove-table>
                <read-only>false</read-only>
                <time-out>300</time-out>
                <pk-constraint>false</pk-constraint>
                <fk-constraint>false</fk-constraint>
                <row-locking>false</row-locking>
                <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
                <read-ahead>
                on-load
                <page-size>1000</page-size>
                <eager-load-group>*</eager-load-group>
                </read-ahead>
                <list-cache-max>1000</list-cache-max>


                Now it says the following:

                2002-03-21 13:09:36,607 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.PartnerJur] Initializing CMP plugin for PartnerJur
                2002-03-21 13:09:37,048 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.PartnerJur] Loading standardjbosscmp-jdbc.xml : file:/C:/Programme/GNU/WinCvs/jboss-all/build/output/jboss-3.0.0beta2/server/default/conf/standardjbosscmp-jdbc.xml
                2002-03-21 13:09:37,118 ERROR [org.jboss.ejb.EntityContainer] Exception in service lifecyle operation: create
                org.jboss.deployment.DeploymentException: expected one row-locking-template tag

                ...and this although I have a row-locking-tag in the xml file as you can see...

                • 5. Re: Can't deploy CMP entity beans with JBoss 3 beta (CVS) an
                  dsundstrom

                  row-locking-template is in the standardjboscmp-jdbc type-mapping elements. I am willing to bet you did not update the standardjbosscmp-jdbc.xml file. If so, get the new one from cvs.

                  • 6. Re: Can't deploy CMP entity beans with JBoss 3 beta (CVS) an
                    houstonbernie

                    Please have a look at the standardjbosscmp-jdbc.xml file attached that I'm using. My MySQLDS datasource does exist BTW, I can see it in the JNDI view. Also I'm using JDK 1.4 (so in order to build JBoss correctly I had to remove some of those comments in some of the classes in the connector directory).

                    Thanks.

                    • 7. Re: Can't deploy CMP entity beans with JBoss 3 beta (CVS) an
                      houstonbernie

                      Problem was solved by getting the latest jbosscmp-jdbc.xml. Strange though, I didn't find it too much different from the one I had before.