Discussions

EJB design: Deployment Of Entity Beans using WebLogic 5.1 Version

  1. When I try to build the xml files using ejbc utility (entity beans using the downloads available in weblogic.com) I get the following error:
    C:\demoejb\sampc>java -classpath \java\lib\classes.zip;\weblogic\classes;\weblog
    ic\lib\weblogicaux.jar;\weblogic\myserver\clientclasses -Dweblogic.home=\weblogi
    c weblogic.ejbc -compiler javac build\std_ejb_basic_containerManaged.jar \weblog
    ic\myserver\ejb_basic_containerManaged.jar
    org.xml.sax.SAXParseException: XML declaration may only begin entities.
            at com.sun.xml.parser.Parser.fatal(Parser.java:2797)
            at com.sun.xml.parser.Parser.fatal(Parser.java:2785)
            at com.sun.xml.parser.Parser.maybePI(Parser.java:938)
            at com.sun.xml.parser.Parser.maybeMisc(Parser.java:1061)
            at com.sun.xml.parser.Parser.parseInternal(Parser.java:478)
            at com.sun.xml.parser.Parser.parse(Parser.java:283)
            at weblogic.xml.dom.SunDOMParser.getDocument(SunDOMParser.java:69)
            at weblogic.xml.dom.DOMParser.getDocument(DOMParser.java:102)
            at weblogic.ejb.deployment.dd.DescriptorLoader.<init>(DescriptorLoader.j
    ava:151)
            at weblogic.ejbc.runBody(ejbc.java:298)
            at weblogic.utils.compiler.Tool.run(Tool.java:80)
            at weblogic.ejbc.main(ejbc.java:353)

    If anybody know the reason for this kind of error.Please post ur answer for this.
  2. This is a problem with one of the XML file (deployment descriptors). Probably one of them is not well-formed.
  3. I would like to paste the XML file which I am using.Please let me know if there is any mistake in the XML files
    Here is the ejb-jar.xml file
    <?xml version="1.0" ?>
      <!DOCTYPE ejb-jar (View Source for full doctype...)>
    - <ejb-jar>
    - <enterprise-beans>
    - <entity>
      <ejb-name>beanManaged</ejb-name>
      <home>examples.ejb.basic.beanManaged.AccountHome</home>
      <remote>examples.ejb.basic.beanManaged.Account</remote>
      <ejb-class>examples.ejb.basic.beanManaged.AccountBean</ejb-class>
      <persistence-type>Bean</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      <reentrant>False</reentrant>
    - <resource-ref>
      <res-ref-name>jdbc/demoPool</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>
      </entity>
      </enterprise-beans>
    - <assembly-descriptor>
    - <container-transaction>
    - <method>
      <ejb-name>beanManaged</ejb-name>
      <method-intf>Remote</method-intf>
      <method-name>*</method-name>
      </method>
      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>

    Here is the XML file for weblogic-jar.xml
    <?xml version="1.0" ?>
      <!DOCTYPE weblogic-ejb-jar (View Source for full doctype...)>
    - <weblogic-ejb-jar>
    - <weblogic-enterprise-bean>
      <ejb-name>beanManaged</ejb-name>
    - <caching-descriptor>
      <max-beans-in-cache>100</max-beans-in-cache>
      </caching-descriptor>
    - <reference-descriptor>
    - <resource-description>
      <res-ref-name>jdbc/demoPool</res-ref-name>
      <jndi-name>weblogic.jdbc.jts.demoPool</jndi-name>
      </resource-description>
      </reference-descriptor>
      <jndi-name>beanManaged.AccountHome</jndi-name>
      </weblogic-enterprise-bean>
      </weblogic-ejb-jar>
    I downloaded both these files from the samples present in weblogic site.I am unable to find out the reason why it is not working
  4. I'm guessing your XML file doesn't literally say:
    "(View Source for full doctype...)"

    Also, are you using a service pack w/ 5.1?

    Jim
  5. 1. You've pasted it from Internet Explorer. Could you use Notepad to copy the XML into the forum?
    2. Can you post your classpath here?

    Wojtek