2 Replies Latest reply on Mar 27, 2002 11:05 AM by Jennifer

    ejb2.0 and cmp

    Jennifer Newbie

      hi
      i just changed from jboss2.2.4 to jboss3.0beta and tryed to deploy a cmp2.0 bean. i understood, that i have to declare the bean class abstract, but i get the following errors, could someone help me, or tell me where i can find an example for an cmp 2.0 bean???

      16:14:57,392 INFO [EJBDeployer]
      Bean : Archive Bean
      Section: 9.2.2
      Warning: The entity bean class must not be defined as abstract.

      16:14:57,402 INFO [EJBDeployer]
      Bean : Archive Bean
      Section: 9.2.2
      Warning: The entity bean class must define a public constructor that takes no ar
      guments.

      16:14:57,422 INFO [EJBDeployer]
      Bean : Archive Bean
      Section: 9.4.7.1
      Warning: The primkey-field element must name a public field in the bean implemen
      tation class.

        • 1. Re: ejb2.0 and cmp
          Hao Wu Newbie

          First thing to check, are you sure you are using EJB 2.0? i.e. you are pointing to the 2.0 DTD in your ejb-jar.xml with the following?

          <!DOCTYPE ejb-jar PUBLIC
          "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
          "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">

          --Hao

          • 2. Re: ejb2.0 and cmp
            Jennifer Newbie

            thanks for your advice. now I have another problem, I can't deploy my bean, i'm getting the following error:

            URL not deployed

            ejb-jar.xml:
            <!DOCTYPE ejb-jar PUBLIC
            "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
            "http://java.sun.com/dtd/ejb-jar_2_0.dtd">


            <ejb-jar>

            <enterprise-beans>

            <ejb-name>Cabin</ejb-name>
            cabin.CabinHomeRemote
            cabin.CabinRemote
            <ejb-class>cabin.CabinBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.lang.Integer</prim-key-class>
            True
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>cabinEJB</abstract-schema-name>
            <cmp-field><field-name>id</field-name></cmp-field>
            <cmp-field><field-name>name</field-name></cmp-field>
            <cmp-field><field-name>deckLevel</field-name></cmp-field>
            <cmp-field><field-name>shipId</field-name></cmp-field>
            <cmp-field><field-name>bedCount</field-name></cmp-field>
            <primkey-field>id</primkey-field>
            <security-identity><use-caller-identity/></security-identity>


            </enterprise-beans>

            <assembly-descriptor>

            <container-transaction>

            <ejb-name>Cabin</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>
            </assembly-descriptor>
            </ejb-jar>

            jboss.xml:

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


            false
            <container-configurations />
            <resource-managers />
            <enterprise-beans>

            <ejb-name>Cabin</ejb-name>
            <jndi-name>cabin</jndi-name>

            </enterprise-beans>


            jbosscmp-jdbc.xml:

            <?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:/OracleDS
            <type-mapping>Oracle8</type-mapping>
            false
            <create-table>true</create-table>
            <remove-table>false</remove-table>
            <pk-constraint>false</pk-constraint>
            <relation-mapping-style>foreign-key</relation-mapping-style>


            <enterprise-beans>

            <ejb-name>CabinBean</ejb-name>
            <table-name>cabin</table-name>
            <cmp-field><field-name>id</field-name><column-name>Id</column-name></cmp-field>
            <cmp-field><field-name>name</field-name><column-name>name</column-name></cmp-field>
            <cmp-field><field-name>deckLevel</field-name><column-name>deckLevel</column-name></cmp-field>
            <cmp-field><field-name>shipId</field-name><column-name>shipId</column-name></cmp-field>
            <cmp-field><field-name>bedCount</field-name><column-name>bedCount</column-name></cmp-field>


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


            I really don't know what I'm doing wrong.