3 Replies Latest reply on Oct 11, 2004 11:23 PM by tjclifford

    bean is not a jbosscmp-jdbc-managed cmp entity in ejb-jar.xm

    newcomer

      Hi
      I am facing this exception while deploying the entity bean
      VTUniqueIDGenerator--"org.jboss.deployment.DeploymentException: Configuration found in jbosscmp-jdbc.xml for entity VTUniqueIDGenerator but bean is not a jbosscmp-jdbc-managed cmp entity in ejb-jar.xml". Could anybody tell me which tag in the ejb-jar.xml make a bean jbosscmp-jdbc-managed bean.Right now the default values are there in the jbosscmp-jdbc-managed. could any body just quote out the benefits retrieved by the content in the jbosscmp-jdbc.xml. What kind of flexibilities it will introduce in the system. Thanks.
      Newcomer

        • 1. Re: bean is not a jbosscmp-jdbc-managed cmp entity in ejb-ja
          mhansen

          I'm facing the same problem. If you have found the solution to the exception I would appreciate any pointers.

          • 2. Re: bean is not a jbosscmp-jdbc-managed cmp entity in ejb-ja
            camueller

            I found part of the solution in a posting:

            <container-configuration extends="Standard CMP EntityBean">

            This still left me with the following exception, which disappeared once _ALL_ CMP EJBs were configured to use this container configuration:

            [ServiceController] Problem starting service jboss.j2ee:jndiName=ejb/mex/MusterGeschaeftLocalHome,service=EJB
            [java] org.jboss.deployment.DeploymentException: Configuration found in jbosscmp-jdbc.xml for entity Geschno but bean is not a jbosscmp-jdbc-managed cmp entity in ejb-jar.xml

            Axel

            • 3. Re: bean is not a jbosscmp-jdbc-managed cmp entity in ejb-ja
              tjclifford

              Newcomer:
              I'm having the same trouble with a SequenceBean I'm using to get
              the next available key from a mySQL database.

              The ejb-jar.xml:

              <?xml version="1.0"?>

              <!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>



              This Office bean represents a sample office,
              including its location.

              <display-name>OfficeBean</display-name>
              <ejb-name>Office</ejb-name>
              com.sample.ejb.office.OfficeHome
              com.sample.ejb.office.Office
              <local-home>com.sample.ejb.office.OfficeLocalHome</local-home>
              com.sample.ejb.office.OfficeLocal
              <ejb-class>com.sample.ejb.office.OfficeBean</ejb-class>
              <persistence-type>Container</persistence-type>
              False
              <cmp-version>2.x</cmp-version>

              <abstract-schema-name>OFFICES</abstract-schema-name>
              <cmp-field>
              <field-name>id</field-name>
              </cmp-field>
              <cmp-field>
              <field-name>city</field-name>
              </cmp-field>
              <cmp-field>
              <field-name>state</field-name>
              </cmp-field>
              <primkey-field>id</primkey-field>
              <prim-key-class>java.lang.Integer</prim-key-class>

              <resource-ref>
              Connection to the sample database.
              <res-ref-name>jdbc/sampledb</res-ref-name>
              <resource-name>sampledb</resource-name>
              <init-param driver-name="com.mysql.jdbc.Driver"/>
              <init-param user="tom"/>
              <init-param password="password"/>
              <res-type>javax.sql.DataSource</res-type>
              <res-auth>Container</res-auth>
              </resource-ref>

              <env-entry>
              <env-entry-name>constants/OfficeKey</env-entry-name>
              <env-entry-type>java.lang.String</env-entry-type>
              <env-entry-value>OFFICES</env-entry-value>
              </env-entry>





              This Sequence bean allows entity beans to obtain primary key
              values as if from a sequence.

              <ejb-name>SequenceBean</ejb-name>
              <local-home>com.sample.ejb.sequence.SequenceLocalHome</local-home>
              com.sample.ejb.sequence.SequenceLocal
              com.sample.ejb.sequence.Sequence
              <ejb-class>com.sample.ejb.sequence.SequenceBean</ejb-class>
              <session-type>Stateless</session-type>
              <!-- 'Container' or 'Bean' ?? -->
              <transaction-type>Container</transaction-type>

              <ejb-local-ref>
              <ejb-ref-name>ejb/SequenceLocalHome</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <local-home>com.sample.ejb.sequence.SequenceLocalHome</local-home>
              com.sample.ejb.sequence.SequenceLocal
              <ejb-link>SequenceBean</ejb-link>
              </ejb-local-ref>


              </enterprise-beans>

              <assembly-descriptor>

              <security-role>
              the ones who have full access to the Cabin EJB
              <role-name>everyone</role-name>
              </security-role>

              <method-permission>
              <role-name>everyone</role-name>
              <ejb-name>SequenceBean</ejb-name>
              <method-name>*</method-name>
              </method-permission>

              <container-transaction>
              <ejb-name>SequenceBean</ejb-name>
              <method-name>*</method-name>
              <trans-attribute>Required</trans-attribute>
              </container-transaction>

              </assembly-descriptor>



              </ejb-jar>

              .......now my jbosscmp-jdbc.xml:

              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE jbosscmp-jdbc PUBLIC
              "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
              "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">

              <jbosscmp-jdbc>


              java:/mySQLDS
              <datasource-mapping>mySQL</datasource-mapping>
              <create-table>true</create-table>
              <remove-table>false</remove-table>
              <read-only>false</read-only>
              <read-time-out>300000</read-time-out>
              <row-locking>false</row-locking>
              <pk-constraint>true</pk-constraint>
              <fk-constraint>false</fk-constraint>
              <preferred-relation-mapping>foreign-key</preferred-relation-mapping>
              <read-ahead>
              on-load
              <page-size>500</page-size>
              <eager-load-group>group name</eager-load-group>
              </read-ahead>


              <enterprise-beans>

              <ejb-name>SequenceBean</ejb-name>
              <table-name>primary_keys</table-name>

              </enterprise-beans>

              </jbosscmp-jdbc>

              .....do you see anything obviously wrong ? I am using
              JBoss 4.0.0 RC2, but have had the same trouble with previous
              versions.

              Thx.

              "newcomer" wrote:
              Hi
              I am facing this exception while deploying the entity bean
              VTUniqueIDGenerator--"org.jboss.deployment.DeploymentException: Configuration found in jbosscmp-jdbc.xml for entity VTUniqueIDGenerator but bean is not a jbosscmp-jdbc-managed cmp entity in ejb-jar.xml". Could anybody tell me which tag in the ejb-jar.xml make a bean jbosscmp-jdbc-managed bean.Right now the default values are there in the jbosscmp-jdbc-managed. could any body just quote out the benefits retrieved by the content in the jbosscmp-jdbc.xml. What kind of flexibilities it will introduce in the system. Thanks.
              Newcomer