2 Replies Latest reply on Feb 10, 2003 4:11 AM by Binder Christian

    could not load class JDBCGetGeneratedKeysCreateCommand

    Allen Walker Newbie

      I deployed a bean that uses the unknown primary key generator: JDBCGetGeneratedKeysCreateCommand

      I ran this on jboss-3.2.0beta2. I uncommented in standardjbosscmp-jdbc.xml:


      <!-- JDK1.4 and JDBC v3 -->
      <entity-command name="get-generated-keys"
      class="org.jboss.ejb.plugins.cmp.jdbc.jdbc3.JDBCGetGeneratedKeysCreateCommand"/>

      My jbosscmp-jdbc.xml:


      <ejb-name>Test</ejb-name>
      <table-name>tblTest</table-name>

      <unknown-pk>
      <unknown-pk-class>java.lang.Integer</unknown-pk-class>
      <column-name>id</column-name>
      <jdbc-type>INTEGER</jdbc-type>
      <sql-type>int</sql-type>
      <auto-increment/>
      </unknown-pk>
      <entity-command name="get-generated-keys"/>

      <cmp-field>
      <field-name>testField</field-name>
      <column-name>testfield</column-name>
      </cmp-field>




      However I get this error message:

      org.jboss.deployment.DeploymentException: Could not load class: org.jboss.ejb.pl
      ugins.cmp.jdbc.jdbc3.JDBCGetGeneratedKeysCreateCommand
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityCommandMetaData.<in
      it>(JDBCEntityCommandMetaData.java:61)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:239)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXm
      lFileLoader.java:67)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaDat
      a(JDBCStoreManager.java:677)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBC
      StoreManager.java:389)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManage
      r.java:339)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManag
      er.java:198)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:359)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      97)
      at org.jboss.ejb.Container.invoke(Container.java:729)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1026)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:962)
      at $Proxy9.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:388)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy42.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:444)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      97)
      at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:962)
      at $Proxy9.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:388)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy23.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:470)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:818)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:630)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:594)
      at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:400)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDe
      ploymentScanner.java:619)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:472)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:195)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
      bstractDeploymentScanner.java:268)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
      97)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
      ler.java:962)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:388)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy5.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:307)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:818)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:630)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:594)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:578)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:325)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:232)
      at org.jboss.Main.boot(Main.java:155)
      at org.jboss.Main$1.run(Main.java:393)
      at java.lang.Thread.run(Thread.java:536)

        • 1. Re: could not load class JDBCGetGeneratedKeysCreateCommand
          sbocquet Newbie

          Hi,

          I have the same problem with JBoss 3.0.5 and an Informix 7.31 database.
          Have you find any solution?
          If Yes, could you give me some informations...

          Thanks a lot,

          Cheers,

          Stéphane

          • 2. Re: could not load class JDBCGetGeneratedKeysCreateCommand
            Binder Christian Newbie

            Hi

            I had a similar problem, this is how I solved it:

            in your jbosscmp-jdbc.xml file in the &lt;default&gt;-Sektion
            drop the following:
            &lt;entity-command name="KEY-GEN"
            class="org.jboss.ejb.plugins.cmp.jdbc.JDBCKeyGeneratorCreateCommand"&gt;
            &lt;attribute name="key-generator-factory"&gt;
            UUIDKeyGeneratorFactory
            &lt;/attribute&gt;
            &lt;/entity-command&gt;

            And in each of your entity-elements there should be a similar element like this:
            &lt;unknown-pk&gt;
            &lt;unknown-pk-class&gt;java.lang.String&lt;/unknown-pk-class&gt;
            &lt;field-name&gt;fieldnamePK&lt;/field-name&gt;
            &lt;column-name&gt;columnnamePK&lt;/column-name&gt;
            &lt;jdbc-type&gt;VARCHAR&lt;/jdbc-type&gt;
            &lt;sql-type&gt;VARCHAR(32)&lt;/sql-type&gt;
            &lt;/unknown-pk&gt;
            where the field-name is the 'name' of the pk-field, so that you can reference it in a relationship and
            column name is the column name in your db.

            DONT forget to comment the key-generator in your standardjbosscmp*.xml.

            I hope this is helpfull.