Bean provided to WebLogic RDBMS CMP system is invalid.

Discussions

EJB programming & troubleshooting: Bean provided to WebLogic RDBMS CMP system is invalid.

  1. hi,
    I am trying to deploy cabin example of orielly but there is error in xml files. In home there is only one findByPrimaryKey() method

    ejb-jar.xml
    <ejb-jar>
     <enterprise-beans>
       <entity>
          <description>
                This Cabin enterprise bean entity represents a cabin on
                a cruise ship.
          </description>
          <ejb-name>CabinBean</ejb-name>
          <home>com.titan.cabin.CabinHome</home>
          <remote>com.titan.cabin.Cabin</remote>
          <ejb-class>com.titan.cabin.CabinBean</ejb-class>
          <persistence-type>Container</persistence-type>
          <prim-key-class>com.titan.cabin.CabinPK</prim-key-class>
          <reentrant>False</reentrant>
          <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>ship</field-name></cmp-field>
          <cmp-field><field-name>bedCount</field-name></cmp-field>
       </entity>
     </enterprise-beans>
     
     <assembly-descriptor>
       <container-transaction>
         <method>
            <ejb-name>CabinBean</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>*</method-name>
         </method>
         <trans-attribute>Required</trans-attribute>
       </container-transaction>
     </assembly-descriptor>
    </ejb-jar>

    weblogic-ejb-jar
    <weblogic-ejb-jar>
        <weblogic-enterprise-bean>
          <ejb-name>CabinBean</ejb-name>
          <caching-descriptor>
    <max-beans-in-cache>1000</max-beans-in-cache>
          </caching-descriptor>
          <persistence-descriptor>
    <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>5.1.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    <persistence-use>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>5.1.0</type-version>
    </persistence-use>
    </persistence-descriptor>
          <jndi-name>ejb.CabinHome</jndi-name>
             </weblogic-enterprise-bean>
      </weblogic-ejb-jar>

    weblogic-cmp-rdbms
    <weblogic-rdbms-bean>
      <pool-name>demoPool</pool-name>
      <table-name>CABIN</table-name>
      <attribute-map>
        <object-link>
          <bean-field>id</bean-field>
          <dbms-column>ID</dbms-column>
        </object-link>
        <object-link>
          <bean-field>ship</bean-field>
          <dbms-column>SHIP_ID</dbms-column>
        </object-link>
        <object-link>
          <bean-field>bedCount</bean-field>
          <dbms-column>BEDCOUNT</dbms-column>
        </object-link>
        <object-link>
          <bean-field>name</bean-field>
          <dbms-column>NAME</dbms-column>
        </object-link>
        <object-link>
          <bean-field>deckLevel</bean-field>
          <dbms-column>DECK_LEVEL</dbms-column>
        </object-link>
      </attribute-map>
    </weblogic-rdbms-bean>

    I want to know in weblogic cmp rdbms is there <finder-list> would come or not.

    Thanks

  2. You need to add finders to (only):
    1. ejb_jar.xml
    2. your home class

    findByPrimaryKey is special, and needs to be listed only in the home class.

    Daniel.