0 Replies Latest reply on Oct 15, 2004 2:42 PM by netsandro

    Oracle CMP with key generated from JBoss

    netsandro

      Observing the code:

       public JDBCCreateCommand createCreateEntityCommand()
       throws DeploymentException
       {
      
       JDBCCreateCommand cec;
       try
       {
       cec = (JDBCCreateCommand)manager.getMetaData().
       getEntityCommand().getCommandClass().newInstance();
       cec.init(manager);
       }
       catch(DeploymentException de)
       {
       throw de;
       }
       catch(Exception e)
       {
       throw new DeploymentException("Couldn't create entity command: ", e);
       }
      
       if(log.isDebugEnabled())
       log.debug("entity-command: " + manager.getMetaData().getEntityCommand());
      
       return cec;
       }
      


      And the exception:
      ...
      2004-10-15 12:35:24,835 ERROR [org.jboss.ejb.EntityContainer] Starting failed jboss.j2ee:jndiName=entity/CounterLocal,service=EJB
      org.jboss.deployment.DeploymentException: Couldn't create entity command: ; - nested throwable: (java.lang.NullPointerException)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createCreateEntityCommand(JDBCCommandFactory.java:159)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.startStoreManager(JDBCStoreManager.java:474)
       at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:396)
       at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:147)
      ...
      


      And the deployment:
       <unknown-pk>
       <unknown-pk-class>java.lang.Long</unknown-pk-class>
       <field-name>id</field-name>
       <column-name>coun_id</column-name>
       <jdbc-type>INTEGER</jdbc-type>
       <sql-type>NUMBER(9)</sql-type>
       <auto-increment/>
       </unknown-pk>
       <entity-command name="bi_counter_sq" class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCOracleCreateCommand">
       <attribute name="sequence">bi_counter_sq</attribute>
       </entity-command>
      


      I have some questions:

      1 - the valid configuration will be from my jbosscmp-jdbc.xml or from the original standardjbosscmp-jdbc.xml ?

      2 - someone know why I'm having these exception ?

      []'s