0 Replies Latest reply: Jul 27, 2012 1:41 PM by 952490 RSS

    Error deploying EJB2.0 on Weblogic10g (10.3)

    952490
      We are upgrading from WL8.1 to WL10g. We have an EJB with multiple modules. These EJBs were written using WL8.1 and now we want to migrate them to WL10g. I am not planning to change any EJB code as part of this migration and trying to get the EJBs up and running in WL10g. Based on the WL10g documentation, EJBs written using EJB 2.0 specification are compatible with WL10g.

      I am using the weblogic.Appc compiler to build and generate dependent EJB classes. Build works correctly but I face issues while deploying the .ear file on WL10g. I started off with getting a ClassNotFoundException for weblogic.ejb20.internal.EntityEJBLocalHome while deploying the .ear file on WL10g. While researching for this issue I came across some posts that talks about converting the deployment descriptors (DD) to relevant version of WL. So I followed the steps and was successful in converting the DD's using weblogic.DDConverter class inside weblogic10.3.jar. I tried to compile and deploy again using the new DD's and now I am getting another ClassNotFoundException for weblogic.ejb20.interface.WLEnterpriseBean. I noticed these missing classes/interfaces are available in weblogic8.1 jar but not in weblogic10.3 jar and hence the ClassNotFoundException. But I have build the EJBs using weblogic.Appc from weblogic10.3 jar and it should have created appropriate stub classes that should have been specific to WL10g.

      Please let me know if you people have any suggestions as to where I can look to resolve this issue.

      Here are the DD's for one of my modules. The files are very large so I am just putting part of the files in this post here.

      ejb-jar.xml
      <?xml version='1.0' encoding='UTF-8'?>
      <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
        <enterprise-beans>
          <session>
            <ejb-name>ProductSession</ejb-name>
            <home>ProductFacade.ejbs.session.ProductSessionHome</home>
            <remote>ProductFacade.ejbs.session.ProductSession</remote>
            <ejb-class>ProductFacade.ejbs.session.ProductSessionBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
            <ejb-local-ref>
              <ejb-ref-name>ProductLocalEntityBean</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <local-home>ProductFacade.ejbs.entity.ProductLocalEntityHome</local-home>
              <local>ProductFacade.ejbs.entity.ProductLocalEntity</local>
              <ejb-link>ProductLocalEntityBean</ejb-link>
            </ejb-local-ref>
            <ejb-local-ref>
              <ejb-ref-name>ComponentLocalEntityBean</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <local-home>ProductFacade.ejbs.entity.ComponentLocalEntityHome</local-home>
              <local>ProductFacade.ejbs.entity.ComponentLocalEntity</local>
              <ejb-link>ComponentLocalEntityBean</ejb-link>
            </ejb-local-ref>
            <ejb-local-ref>
              <ejb-ref-name>RoleLocalEntityBean</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <local-home>ProductFacade.ejbs.entity.RoleLocalEntityHome</local-home>
              <local>ProductFacade.ejbs.entity.RoleLocalEntity</local>
              <ejb-link>RoleLocalEntityBean</ejb-link>
            </ejb-local-ref>
            <ejb-local-ref>
              <ejb-ref-name>ProductRoleLocalEntityBean</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <local-home>ProductFacade.ejbs.entity.ProductRoleLocalEntityHome</local-home>
              <local>ProductFacade.ejbs.entity.ProductRoleLocalEntity</local>
              <ejb-link>ProductRoleLocalEntityBean</ejb-link>
            </ejb-local-ref>
            <security-identity>
              <use-caller-identity></use-caller-identity>
            </security-identity>
          </session>
          <entity>
            <ejb-name>ProductLocalEntityBean</ejb-name>
            <local-home>ProductFacade.ejbs.entity.ProductLocalEntityHome</local-home>
            <local>ProductFacade.ejbs.entity.ProductLocalEntity</local>
            <ejb-class>ProductFacade.ejbs.entity.ProductLocalEntityBean</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>Product</abstract-schema-name>
            <cmp-field>
              <field-name>productName</field-name>
            </cmp-field>
            <cmp-field>
              <field-name>abbreviation</field-name>
            </cmp-field>
            <cmp-field>
              <field-name>description</field-name>
            </cmp-field>
      ...
      ...
      weblogic-ejb-jar.xml
      <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/weblogic-ejb-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-ejb-jar http://www.bea.com/ns/weblogic/weblogic-ejb-jar/1.0/weblogic-ejb-jar.xsd">
        <weblogic-enterprise-bean>
          <ejb-name>ProductLocalEntityBean</ejb-name>
          <entity-descriptor>
            <pool></pool>
            <entity-cache>
              <max-beans-in-cache>1000</max-beans-in-cache>
            </entity-cache>
            <persistence>
              <persistence-use>
                <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
                <type-version>7.0</type-version>
                <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
              </persistence-use>
            </persistence>
            <entity-clustering></entity-clustering>
          </entity-descriptor>
          <transaction-descriptor></transaction-descriptor>
          <local-jndi-name>ProductLocalEntityBean</local-jndi-name>
        </weblogic-enterprise-bean>
        <weblogic-enterprise-bean>
          <ejb-name>ComponentLocalEntityBean</ejb-name>
          <entity-descriptor>
            <pool></pool>
            <entity-cache>
              <max-beans-in-cache>1000</max-beans-in-cache>
            </entity-cache>
            <persistence>
              <persistence-use>
                <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
                <type-version>7.0</type-version>
                <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
              </persistence-use>
            </persistence>
            <entity-clustering></entity-clustering>
          </entity-descriptor>
          <transaction-descriptor></transaction-descriptor>
          <local-jndi-name>ComponentLocalEntityBean</local-jndi-name>
        </weblogic-enterprise-bean>
        <weblogic-enterprise-bean>
          <ejb-name>RoleLocalEntityBean</ejb-name>
          <entity-descriptor>
            <pool></pool>
            <entity-cache>
              <max-beans-in-cache>1000</max-beans-in-cache>
            </entity-cache>
            <persistence>
              <persistence-use>
                <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
                <type-version>7.0</type-version>
                <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
              </persistence-use>
            </persistence>
            <entity-clustering></entity-clustering>
          </entity-descriptor>
          <transaction-descriptor></transaction-descriptor>
          <local-jndi-name>RoleLocalEntityBean</local-jndi-name>
        </weblogic-enterprise-bean>
        <weblogic-enterprise-bean>
          <ejb-name>ProductRoleLocalEntityBean</ejb-name>
          <entity-descriptor>
            <pool></pool>
            <entity-cache>
              <max-beans-in-cache>1000</max-beans-in-cache>
            </entity-cache>
            <persistence>
              <persistence-use>
                <type-identifier>WebLogic_CMP_RDBMS</type-identifier>
                <type-version>7.0</type-version>
                <type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
              </persistence-use>
            </persistence>
            <entity-clustering></entity-clustering>
          </entity-descriptor>
          <transaction-descriptor></transaction-descriptor>
          <local-jndi-name>ProductRoleLocalEntityBean</local-jndi-name>
        </weblogic-enterprise-bean>
        <weblogic-enterprise-bean>
          <ejb-name>ProductSession</ejb-name>
          <stateless-session-descriptor>
            <pool></pool>
            <stateless-clustering></stateless-clustering>
          </stateless-session-descriptor>
          <transaction-descriptor></transaction-descriptor>
          <enable-call-by-reference>true</enable-call-by-reference>
          <jndi-name>ProductSessionBean</jndi-name>
        </weblogic-enterprise-bean>
        <weblogic-compatibility>
          <entity-always-uses-transaction>true</entity-always-uses-transaction>
        </weblogic-compatibility>
      </weblogic-ejb-jar>
      weblogic-cmp-rdbms-jar.xml
      <weblogic-rdbms-jar xmlns="http://www.bea.com/ns/weblogic/weblogic-rdbms-jar" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-rdbms-jar http://www.bea.com/ns/weblogic/weblogic-rdbms-jar/1.0/weblogic-rdbms20-persistence.xsd">
        <weblogic-rdbms-bean>
          <ejb-name>ProductLocalEntityBean</ejb-name>
          <data-source-jndi-name>jdbc.BPASReportDB</data-source-jndi-name>
          <table-map>
            <table-name>Product</table-name>
            <field-map>
              <cmp-field>abbreviation</cmp-field>
              <dbms-column>abbreviation</dbms-column>
            </field-map>
            <field-map>
              <cmp-field>productName</cmp-field>
              <dbms-column>Product_Name</dbms-column>
            </field-map>
            <field-map>
              <cmp-field>description</cmp-field>
              <dbms-column>description</dbms-column>
            </field-map>
            <field-map>
              <cmp-field>targetUserType</cmp-field>
              <dbms-column>Target_User_Type</dbms-column>
            </field-map>
            <field-map>
              <cmp-field>portal</cmp-field>
              <dbms-column>portal</dbms-column>
            </field-map>
            <field-map>
              <cmp-field>sslvpnAccess</cmp-field>
              <dbms-column>sslvpn_Access</dbms-column>
            </field-map>
            <field-map>
              <cmp-field>approvalProcessName</cmp-field>
              <dbms-column>approval_process_name</dbms-column>
            </field-map>
      ...
      ...