facebook

weblogic.ejb20.deployer.DeploymentDescriptorException: Unabl

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #268220 Reply

    jadeite1000
    Member

    Hi:

    I am using MyEclipse 5.1 and Weblogic 8.1. I tried to deploy an enterprise application(an ejb application) and I get the following error:

    weblogic.ejb20.deployer.DeploymentDescriptorException: Unable to load a class specified in your ejb-jar.xml: Class bytes found but defineClass()failed for: ‘com.CategoryBean’

    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”&gt;

    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>CategoryEJB</ejb-name>
    <local-home>com.CategoryHomeLocal</local-home>
    <local>com.CategoryLocal</local>
    <ejb-class>com.CategoryBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Category</abstract-schema-name>
    <cmp-field><field-name>categoryId</field-name></cmp-field>
    <cmp-field><field-name>categoryName</field-name></cmp-field>
    <cmp-field><field-name>picture</field-name></cmp-field>
    <cmp-field><field-name>pictureWidth</field-name></cmp-field>
    <cmp-field><field-name>pictureHeight</field-name></cmp-field>
    <cmp-field><field-name>labelOn</field-name></cmp-field>
    <cmp-field><field-name>labelOff</field-name></cmp-field>
    <cmp-field><field-name>button</field-name></cmp-field>

    <primkey-field>categoryId</primkey-field>
    <security-identity><use-caller-identity/></security-identity>
    <query>
    <query-method>
    <method-name>findCategory</method-name>
    <method-params></method-params>
    </query-method>
    <ejb-ql>
    SELECT OBJECT(c) FROM Category c
    </ejb-ql>
    </query>
    </entity>
    <entity>
    <ejb-name>ProductEJB</ejb-name>
    <local-home>com.ProductHomeLocal</local-home>
    <local>com.ProductLocal</local>
    <ejb-class>com.ProductBean</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.Integer</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>Product</abstract-schema-name>
    <cmp-field><field-name>productId</field-name></cmp-field>
    <cmp-field><field-name>brandName</field-name></cmp-field>
    <cmp-field><field-name>productDescription</field-name></cmp-field>
    <cmp-field><field-name>purchasePrice</field-name></cmp-field>

    <primkey-field>productId</primkey-field>
    <security-identity><use-caller-identity/></security-identity>
    <query>
    <query-method>
    <method-name>findProduct</method-name>
    <method-params>
    <method-param>com.CategoryLocal</method-param>
    </method-params>
    </query-method>
    <ejb-ql>
    SELECT OBJECT(p) FROM Product p, Category c where c = ?1
    </ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <relationships>
    <ejb-relation>
    <ejb-relation-name>Category-Product</ejb-relation-name>
    <ejb-relationship-role>
    <ejb-relationship-role-name>
    Category-has-many-Product-numbers
    </ejb-relationship-role-name>
    <multiplicity>one</multiplicity>
    <relationship-role-source>
    <ejb-name>CategoryEJB</ejb-name>
    </relationship-role-source>
    <cmr-field>
    <cmr-field-name>productNumbers</cmr-field-name>
    <cmr-field-type>java.util.Collection</cmr-field-type>
    </cmr-field>
    </ejb-relationship-role>
    <ejb-relationship-role>
    <ejb-relationship-role-name>
    Product-belongs-to-Category
    </ejb-relationship-role-name>
    <multiplicity>many</multiplicity>
    <cascade-delete/>
    <relationship-role-source>
    <ejb-name>ProductEJB</ejb-name>
    </relationship-role-source>
    </ejb-relationship-role>
    </ejb-relation>
    </relationships>
    <assembly-descriptor>
    <security-role>
    <role-name>Employees</role-name>
    </security-role>
    <method-permission>
    <role-name>Employees</role-name>
    <method>
    <ejb-name>CategoryEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    </method-permission>
    <container-transaction>
    <method>
    <ejb-name>CategoryEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    <method>
    <ejb-name>ProductEJB</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>

    </ejb-jar>

    Here is my weblogic-cmp-rdbms-jar.xml:
    <!DOCTYPE weblogic-rdbms-jar PUBLIC
    ‘-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB RDBMS Persistence//EN’
    http://www.bea.com/servers/wls810/dtd/weblogic-rdbms20-persistence-810.dtd’&gt;
    <weblogic-rdbms-jar>

    <weblogic-rdbms-bean>
    <ejb-name>CategoryEJB</ejb-name>
    <data-source-name>ShoeStore</data-source-name>
    <table-map>
    <table-name>category</table-name>
    <field-map>
    <cmp-field>categoryId</cmp-field>
    <dbms-column>categoryID</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>categoryName</cmp-field>
    <dbms-column>categoryName</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>picture</cmp-field>
    <dbms-column>Picture</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>pictureWidth</cmp-field>
    <dbms-column>PictureWidth</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>pictureHeight</cmp-field>
    <dbms-column>PictureHeight</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>labelOn</cmp-field>
    <dbms-column>LabelOn</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>labelOff</cmp-field>
    <dbms-column>LabelOff</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>button</cmp-field>
    <dbms-column>Button</dbms-column>
    </field-map>
    </table-map>
    <automatic-key-generation>
    <generator-type>SQL_SERVER</generator-type>

    </automatic-key-generation>
    </weblogic-rdbms-bean>

    <weblogic-rdbms-bean>
    <ejb-name>ProductEJB</ejb-name>
    <data-source-name>ShoeStore</data-source-name>
    <table-map>
    <table-name>PRODUCT</table-name>
    <field-map>
    <cmp-field>productId</cmp-field>
    <dbms-column>productId</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>brandName</cmp-field>
    <dbms-column>brandName</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>productDescription</cmp-field>
    <dbms-column>productDescription</dbms-column>
    </field-map>
    <field-map>
    <cmp-field>purchasePrice</cmp-field>
    <dbms-column>purchasePrice</dbms-column>
    </field-map>
    </table-map>

    <!– Automatically generate the value of ID in the database on inserts using sequence table –>
    <automatic-key-generation>
    <generator-type>SQL_SERVER</generator-type>

    </automatic-key-generation>

    </weblogic-rdbms-bean>
    <weblogic-rdbms-relation>
    <relation-name>Category-Product</relation-name>
    <weblogic-relationship-role>
    <relationship-role-name>Product-belongs-to-Category</relationship-role-name>
    <relationship-role-map>
    <column-map>
    <foreign-key-column>categoryId</foreign-key-column>
    <key-column>categoryID</key-column>
    </column-map>
    </relationship-role-map>
    </weblogic-relationship-role>
    </weblogic-rdbms-relation>

    </weblogic-rdbms-jar>

    Here is my weblogic-ejb-jar.xml:
    <?xml version=”1.0″?>

    <!DOCTYPE weblogic-ejb-jar PUBLIC “-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN” “http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd”&gt;

    <weblogic-ejb-jar>

    <weblogic-enterprise-bean>

    <ejb-name>CategoryEJB</ejb-name>

    <entity-descriptor>

    <entity-cache>
    <max-beans-in-cache>100</max-beans-in-cache>
    </entity-cache>

    <persistence>
    <persistence-use>
    <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-use>
    </persistence>

    </entity-descriptor>

    <local-jndi-name>CategoryHomeLocal</local-jndi-name>

    </weblogic-enterprise-bean>

    <weblogic-enterprise-bean>

    <ejb-name>ProductEJB</ejb-name>

    <entity-descriptor>

    <entity-cache>
    <max-beans-in-cache>100</max-beans-in-cache>
    </entity-cache>

    <persistence>
    <persistence-use>
    <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-use>
    </persistence>

    </entity-descriptor>

    <local-jndi-name>ProductHomeLocal</local-jndi-name>

    </weblogic-enterprise-bean>
    <!– Map the ejbbook user to the Employees role –>
    <security-role-assignment>
    <role-name>Employees</role-name>
    <principal-name>ejbbook</principal-name>
    </security-role-assignment>

    </weblogic-ejb-jar>

    Here is my weblogic.xml:
    <!DOCTYPE weblogic-web-app PUBLIC “-//BEA Systems, Inc.//DTD Web Application 8.1//EN” “http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd”&gt;
    <weblogic-web-app>
    <description>WebLogic Descriptor</description>

    <jsp-descriptor>
    <jsp-param>
    <param-name>debug</param-name>
    <param-value>true</param-value>
    </jsp-param>
    <jsp-param>
    <param-name>keepgenerated</param-name>
    <param-value>true</param-value>
    </jsp-param>
    </jsp-descriptor>
    <container-descriptor>
    <servlet-reload-check-secs>-1</servlet-reload-check-secs>
    <prefer-web-inf-classes>true</prefer-web-inf-classes>
    </container-descriptor>
    </weblogic-web-app>

    Any help would be greatly appreciated.

    Yours,

    Frustrated!!

    #268250 Reply

    Riyad Kalla
    Member

    Try and remove the deployment and re-deploy it as a packaged deployment.

    Also if you check your project properties for each project that is part of the EAR, make sure you have Java 1.4 compliance set for the compiler, if you have Java 5 or higher, it won’t work.

    #298416 Reply

    i am facing the sane problem. but when i set prefarrances and compiler for jdk 1.4 then build is failed for my entity bean. i m using myeclipse 6.5 and weblogic 8.1.

    #298498 Reply

    support-joy
    Member

    Have you tried to remove your existing deployment and re-deploy as a packaged deployment? Can you copy and paste your installation details here? You can get it from MyEclipse > Installation Summary > Installation Details. Can you attach a screen shot of your preferences and deployment. Also what is the exact error you are getting? Can you copy and paste the same from your log file. You log file is located at [your workspace dir]/.metadata/.log

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: weblogic.ejb20.deployer.DeploymentDescriptorException: Unabl

You must be logged in to post in the forum log in