Exception at the time of deployment of ejbs in Weblogic5.1

Discussions

EJB programming & troubleshooting: Exception at the time of deployment of ejbs in Weblogic5.1

  1. Hi friends,
    Am facing a problem while deploying the Ejb(Stateful session bean) in Weblogic App server 5.1.

    After creating a jar file (which includes all class files and the 2 xml files)
    and running the following command
    java -Dweblogic.home=%WL_HOME% weblogic.ejbc -compiler javac build\temp.jar %DIAG_HOME%\deploy\DIAG%1.jar

    at the command prompt
    am getting the exception mentioned below.



    EXCEPTION:::
    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.java:151)
            at weblogic.ejbc.runBody(ejbc.java, Compiled Code)
            at weblogic.utils.compiler.Tool.run(Tool.java:80)
            at weblogic.ejbc.main(ejbc.java:353)
    --------------- nested within: ------------------
    Received SAXParseException from Sun Parser at line 1, column -1: org.xml.sax.SAXParseException: XML declaration may only begin entities.
            at weblogic.xml.dom.SunDOMParser.getDocument(SunDOMParser.java:72)
            at weblogic.xml.dom.DOMParser.getDocument(DOMParser.java:102)
            at weblogic.ejb.deployment.dd.DescriptorLoader.<init>(DescriptorLoader.java:151)
            at weblogic.ejbc.runBody(ejbc.java, Compiled Code)
            at weblogic.utils.compiler.Tool.run(Tool.java:80)
            at weblogic.ejbc.main(ejbc.java:353)
    ERROR: Received SAXParseException from Sun Parser at line 1, column -1: org.xml.sax.SAXParseException: XML declaration may only begin entities.

    Kindly could anyone look into it N help me 2 sort out this problem.
    Thanks
    Yogi
  2. Do check the XML deployment descriptors.Mostly there will be an error in the start of the XML file.
  3. The XML file(deployment descriptor) is properly written
    I have checked it ,but if i give a space at the starting
    like this
    <? xml version="1.0"?> then that error doesnt appear but a different error appears.
    So what i meant 2 say is my XML file is proper .
    May B some other problem.SO plz do suggest some soln.
    yogi
  4. Maybe posting both the XML files here could help....
  5. Hi duby rex ,

    Iam sorry ,i got the solution fixed .
    Yah there was a problem in the XML file ,I dont know y ,i wrote the same XML file again ,it worked fine.
    Thanx