Weblogic 6.0 problem

Discussions

EJB programming & troubleshooting: Weblogic 6.0 problem

  1. Weblogic 6.0 problem (4 messages)

    Hi,
      This is specific to Weblogic server 6.0. Suppose I've two CMP(ejb2.0) beans say. In my weblogic-ejb-jar.xml file, the persistent entities are refered as follows
    <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type- identifier>
    <type-version>6.0</type-version>
    <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
    </persistence-type>
    That means it is refering the bean descriptors weblogic-cmp-rdbms-jar.xml In that file, I've corresponding entries for the above two CMP beans. But when i do weblogic.ejbc20 it throws error like
     ERROR: Error from ejbc: Unable to find bean 'BeanName' in RDBMS CMP deployment descriptor 'META-INF/weblogic-cmp-rdbms-jar.xml'. The bean references this descriptor, but the
    doesn't contain an entry for this bean.
    java.lang.reflect.InvocationTargetException: weblogic.utils.compiler.ToolFailureException: ERROR: ejbc found errors
         at weblogic.ejbc20.runBody(ejbc20.java:388)
         at weblogic.utils.compiler.Tool.run(Tool.java:81)
         at weblogic.ejbc20.main(ejbc20.java:419)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.transentric.tools.ant.taskdefs.WebLogicEjbTool.main(WebLogicEjbTool.java:293)

    Any help would be appreciatable.

    Thanks
    prabu
  2. Weblogic 6.0 problem[ Go to top ]

    Prabu,
    Check the spelling and case (lower vs upper) of your bean names. Make sure they match exactly. If that doesn't work then check again. If that doesn't work then post your Deplyment Descriptors here.
    -Anil
  3. Ejb-Jar :
    ---------

    <?xml version="1.0"?>
    <!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) -->
    <!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>
    <entity>
    <ejb-name>Address</ejb-name>
    <home>com.transentric.itemvision.server.ejb.location.entity.AddressHome</home>
    <remote>com.transentric.itemvision.server.ejb.location.entity.Address</remote>
    <ejb-class>com.transentric.itemvision.server.ejb.location.entity.AddressBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Address</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>addressLine1</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>addressLine2</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>addressLine3</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>city</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>state</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>postalCode</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>county</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>country</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>phoneNumber</field-name>
    </cmp-field>
    <primkey-field>id</primkey-field>
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params/>
    </query-method>
    <ejb-ql><![CDATA[WHERE 1=1]]></ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findByName</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[WHERE name = ?1]]></ejb-ql>
    </query>
    </entity>
    <entity>
    <ejb-name>Contact</ejb-name>
    <home>com.transentric.itemvision.server.ejb.location.entity.ContactHome</home>
    <remote>com.transentric.itemvision.server.ejb.location.entity.Contact</remote>
    <ejb-class>com.transentric.itemvision.server.ejb.location.entity.ContactBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Contact</abstract-schema-name>
    <cmp-field>
    <field-name>id</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>contactName</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>designation</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>contactPhoneNumber1</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>contactPhoneNumber2</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>contactPhoneNumber3</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>faxNumber</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>email</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>addressId</field-name>
    </cmp-field>
    <primkey-field>id</primkey-field>
    <query>
    <query-method>
    <method-name>findAll</method-name>
    <method-params/>
    </query-method>
    <ejb-ql><![CDATA[WHERE 1=1]]></ejb-ql>
    </query>
    <query>
    <query-method>
    <method-name>findByContactName</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    </method-params>
    </query-method>
    <ejb-ql><![CDATA[WHERE contactName = ?1]]></ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>Address</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    <container-transaction>
    <method>
    <ejb-name>Contact</ejb-name>
    <method-intf>Remote</method-intf>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>

    weblogic-cmp-rdbms-jar.xml
    --------------------------

    <!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) -->
    <!DOCTYPE weblogic-rdbms-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB RDBMS Persistence//EN'
     'http://www.bea.com/servers/wls600/dtd/weblogic-rdbms20-persistence-600.dtd'>
    <weblogic-rdbms-jar>
    <weblogic-rdbms-bean>
    <ejb-name>Address</ejb-name>
    <data-source-name>itemvision.jdbc.IVPoolDS</data-source-name>
    <table-name>Address</table-name>
    <field-map>
    <cmp-field>id</cmp-field>
    <dbms-column>ID</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>name</cmp-field>
    <dbms-column>Name</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>addressLine1</cmp-field>
    <dbms-column>AddressLine1</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>addressLine2</cmp-field>
    <dbms-column>AddressLine2</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>addressLine3</cmp-field>
    <dbms-column>AddressLine3</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>city</cmp-field>
    <dbms-column>City</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>state</cmp-field>
    <dbms-column>State</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>postalCode</cmp-field>
    <dbms-column>PostalCode</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>county</cmp-field>
    <dbms-column>County</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>country</cmp-field>
    <dbms-column>Country</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>phoneNumber</cmp-field>
    <dbms-column>PhoneNumber</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    <weblogic-rdbms-bean>
    <ejb-name>Contact</ejb-name>
    <data-source-name>itemvision.jdbc.IVPoolDS</data-source-name>
    <table-name>Contact</table-name>
    <field-map>
    <cmp-field>id</cmp-field>
    <dbms-column>ID</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>contactName</cmp-field>
    <dbms-column>ContactName</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>designation</cmp-field>
    <dbms-column>Designation</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>contactPhoneNumber1</cmp-field>
    <dbms-column>Contact_Phone_Number1</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>contactPhoneNumber2</cmp-field>
    <dbms-column>Contact_Phone_Number2</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>contactPhoneNumber3</cmp-field>
    <dbms-column>Contact_Phone_Number3</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>faxNumber</cmp-field>
    <dbms-column>FaxNumber</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>email</cmp-field>
    <dbms-column>Email</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>addressId</cmp-field>
    <dbms-column>Address_Id</dbms-column>
    </field-map>
    </weblogic-rdbms-bean>
    </weblogic-rdbms-jar>

    weblogic-ejb-jar.xml
    --------------------

    <?xml version="1.0"?>
    <!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) -->
    <!DOCTYPE weblogic-ejb-jar PUBLIC "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN" "http://www.bea.com/servers/wls600/dtd/weblogic-ejb-jar.dtd">
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>Address</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.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>6.0</type-version>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <jndi-name>ContainerManaged.AddressHome</jndi-name>
    </weblogic-enterprise-bean>
    <weblogic-enterprise-bean>
    <ejb-name>Contact</ejb-name>
    <entity-descriptor>
    <persistence>
    <persistence-type>
    <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
    <type-version>6.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>6.0</type-version>
    </persistence-use>
    </persistence>
    </entity-descriptor>
    <jndi-name>ContainerManaged.ContactHome</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
  4. Prabu,
    I do not see anything wrong with these. Please check your environment.
    -Anil
  5. There is a bug in EJBC compiler...I doesn't overwrite the previous build directories which made me sick...We got to delete the old directories before starting the new build process
    Thanks
    prabu