1 Reply Latest reply on Mar 30, 2002 11:03 AM by jphekman

    DeploymentException with CMP2.0

    jphekman

      I am migrating from JBoss 2.4 to 3.0 in order to use CMP2.0, and having some problems. I'm using the AutoNumber in org.jboss.varia.autonumer (I built the jar file myself as it does not seem to be built in the general build for JBoss 3.0); had no problems with JAWS, but under CMP2.0 I am getting the following exception:

      10:30:02,070 ERROR [ServiceController] JMException thrown during ServiceProxy operation create on mbcomplete errean jboss.j2ee:service=EJB,jndiName=JBossUtilAutoNumber
      org.jboss.deployment.DeploymentException: No abstract accessors for field named 'id' found in entity class.

      There are indeed no such accessors, but why is CMP looking for them? I didn't mention them in ejb-jar.xml or in jbosscmp-jdbc.xml.

      The relevant part of ejb-jar.xml:


      <ejb-name>JBossUtilAutoNumber</ejb-name>
      org.jboss.varia.autonumber.AutoNumberHome
      org.jboss.varia.autonumber.AutoNumber
      <ejb-class>org.jboss.varia.autonumber.AutoNumberEJB2</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      True
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>autonumber</abstract-schema-name>
      <cmp-field><field-name>name</field-name></cmp-field>
      <cmp-field><field-name>value</field-name></cmp-field>
      <primkey-field>name</primkey-field>



      jbosscmp-jdbc.xml in its entirety:

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
      "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">

      <jbosscmp-jdbc>

      java:/DefaultDS
      <datasource-mapping>Hypersonic SQ</datasource-mapping>


      <enterprise-beans>

      <ejb-name>JBossUtilAutoNumber</ejb-name>
      <table-name>JBossUtilAutoNumberEJBTable</table-name>
      <create-table>true</create-table>
      <remove-table>true</remove-table>
      <tuned-updates>true</tuned-updates>
      <read-only>false</read-only>
      <time-out>300</time-out>
      <pk-constraint>false</pk-constraint>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>
      <sql-type>VARCHAR(30)</sql-type>
      <jdbc-type>VARCHAR</jdbc-type>
      </cmp-field>
      <cmp-field>
      <field-name>value</field-name>
      <column-name>value</column-name>
      </cmp-field>

      </enterprise-beans>
      </jbosscmp-jdbc>

      I suspect that the jbosscmp-jdbc.xml file is not actually being processed, because I have tried introducing well-formedness errors into it, and I do not see any exceptions thrown in response to that.

      j

        • 1. Re: DeploymentException with CMP2.0
          jphekman

          All right, it's working now. I changed various things, but I believe what made the difference was ensuring that I was actually setting the primary key in the ejbCreate method of the bean (AutoNumberEJB2) class. I got into this fix originally by messing with JBoss util code which (I believe) isn't really supported any more and trying to make it work. In case anyone in charge browses this thread, I would like to say that (assuming that is in fact what fixed this) the original error message was misleading, so it'd be great to see that change at some point. I'd imagine that's low-priority, though.

          Jessica