Problem in deploying EJB 2.0 in Weblogic 6.1

Discussions

EJB programming & troubleshooting: Problem in deploying EJB 2.0 in Weblogic 6.1

  1. Problem in deploying EJB 2.0 in Weblogic 6.1 (6 messages)

    Hi, i am using Weblogic 6.1 to deploy entity bean having local interface only, i am not providing remote interface. i have a session bean which will aceess this entity bean vai the local interface. for that i have declared local-ref in ejb-jar.xml. but while trying to deploy in weblogic 6.1, i got the following error:
    <Oct 15, 2003 3:07:24 PM IST> <Error> <J2EE> <Error deploying application message_test:

    <font color="red">Unable to deploy EJB: message_test.jar from message_test.jar:
    <br>
    The XML parser encountered an error in your deployment descriptor. Please ensure that your deployment descriptor corresponds to the format in the DTD.
    <br>
    The error was:
    org.xml.sax.SAXParseException: Element type "ejb-local-ref" must be declared. </font>
    <br>
    <br>
    Here is the ejb-jar.xml:

    <?xml version="1.0"?>

    <!DOCTYPE ejb-jar PUBLIC
    '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN'
    'http://www.java.sun.com/dtd/ejb-jar_2_0.dtd'>

    <ejb-jar>
        <enterprise-beans>
          <session>
    <ejb-name>sessionTest</ejb-name>
    <home>test.MessageHandlerHome</home>
    <remote>test.MessageHandler</remote>
    <ejb-class>test.MessageHandlerEJB</ejb-class>
    <session-type>Stateless</session-type>
    :
    <ejb-local-ref>
    <ejb-ref-name>ejb/MessageBean</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>test.MessageLocalHome</local-home>
    <local>test.MessageLocal</local>
    </ejb-local-ref>
          </session>

          <entity>
            <ejb-name>MessageEntity</ejb-name>
            <local-home>test.MessageLocalHome</local-home>
    <local>test.MessageLocal</local>
    <ejb-class>test.MessageEJB</ejb-class>
    <persistence-type>Container</persistence-type>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    :
    :
        </entity>

        </enterprise-beans>
        :
        :
    ejb-jar>
  2. According to your error message, there is something wrong with your XML file, but I don't see anything obvious. Try opening your ejb-jar.xml file in a web browser to see what error messages you get in a different environment.
  3. i tried by opening ejb-jar.xml in IE, it opens fine, no error message. is there anything in Weblogic 6.1 to enable EJB 2.0? what is the default EJB version in Weblogic 6.1? it is 1.1? It seems to me that Weblogic 6.1 is unable to recognize new XML elements in EJB 2.0.
    help/suggesions are welcome. thanks in advance.
  4. Duh. I am being stupid. Yes, weblogic 6.1 is EJB 1.1, not EJB 2.0, so it won't recognize the newer XML tags. Also, it won't support local interfaces either. Your options are:

    1. Upgrade weblogic to a new server.
    2. Rewrite your EJBs to be EJB 1.1 compliant.
  5. Duh. I am being stupid. Yes, weblogic 6.1 is EJB 1.1, not EJB 2.0, so it won't recognize the newer XML tags. Also, it won't support local interfaces either. Your options are:


    6.1 came out before EJB 2.0 was final so it did not support all ejb 2.0 features. There is a j2ee12.jar that you can include to get the full ejb 2.0 functionality. I think some of the later 6.1 download include this jar by default.
  6. Hi, i have checked the doc that came with my Weblogic installation, it claims it supports EJB 2.0. Also i have checked j2ee12.jar, it doesn't have new interfaces/classes required for EJB 2.0. But i have found these new classes in Weblogic.jar. What can be the reason?
  7. Your doctype has an EJB 1.1 reference in it - these are the ones I have used for EJB 2.0 in WL61:

    ejb-jar.xml:
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>

    weblogic-ejb-jar.xml:
    <!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-cmp-rdbms-jar.xml:
    <!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'>