Content is not allowed in prolog

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg Scharlemann

    #1

    Content is not allowed in prolog

    I have set up Apache Axis with a Resin server. Everything seems to be
    set up correctly, axis will validate if I display the
    http://axis.scharlemann.com/axis/happyaxis.jsp file. However when I
    attempt to run a simple web service example
    (http://ws.apache.org/axis/ click on publishing web service for the
    Calculator example) I get the following error:


    #: java samples/userguide/example2/CalcClient -p80 add 2 5

    Exception in thread "main" AxisFault
    faultCode: {http://schemas.xmlsoap .org/soap/envelope/}Server.userExc eption
    faultSubcode:
    faultString: org.xml.sax.SAX ParseException: Content is not allowed in
    prolog.
    faultActor:
    faultNode:
    faultDetail:
    {http://xml.apache.org/axis/}stackTrace:
    org.xml.sax.SAX ParseException: Content is not allowed in prolog.
    at org.apache.xerc es.parsers.Abst ractSAXParser.p arse(Unknown
    Source)
    at javax.xml.parse rs.SAXParser.pa rse(SAXParser.j ava:345)
    at org.apache.axis .encoding.Deser ializationConte xtImpl.parse(De serializationCo ntextImpl.java: 242)
    at org.apache.axis .SOAPPart.getAs SOAPEnvelope(SO APPart.java:538 )
    at org.apache.axis .Message.getSOA PEnvelope(Messa ge.java:376)
    at org.apache.axis .client.Call.in vokeEngine(Call .java:2583)
    at org.apache.axis .client.Call.in voke(Call.java: 2553)
    at org.apache.axis .client.Call.in voke(Call.java: 2248)
    at org.apache.axis .client.Call.in voke(Call.java: 2171)
    at org.apache.axis .client.Call.in voke(Call.java: 1691)
    at samples.usergui de.example2.Cal cClient.main(Ca lcClient.java:9 8)


    org.xml.sax.SAX ParseException: Content is not allowed in prolog.
    at org.apache.axis .AxisFault.make Fault(AxisFault .java:129)
    at org.apache.axis .SOAPPart.getAs SOAPEnvelope(SO APPart.java:543 )
    at org.apache.axis .Message.getSOA PEnvelope(Messa ge.java:376)
    at org.apache.axis .client.Call.in vokeEngine(Call .java:2583)
    at org.apache.axis .client.Call.in voke(Call.java: 2553)
    at org.apache.axis .client.Call.in voke(Call.java: 2248)
    at org.apache.axis .client.Call.in voke(Call.java: 2171)
    at org.apache.axis .client.Call.in voke(Call.java: 1691)
    at samples.usergui de.example2.Cal cClient.main(Ca lcClient.java:9 8)
    Caused by: org.xml.sax.SAX ParseException: Content is not allowed in
    prolog.
    at org.apache.xerc es.parsers.Abst ractSAXParser.p arse(Unknown
    Source)
    at javax.xml.parse rs.SAXParser.pa rse(SAXParser.j ava:345)
    at org.apache.axis .encoding.Deser ializationConte xtImpl.parse(De serializationCo ntextImpl.java: 242)
    at org.apache.axis .SOAPPart.getAs SOAPEnvelope(SO APPart.java:538 )
    ... 7 more


    I think it might have something to do with the xml parser that I am
    using, but I have defined xercesImpl.jar and xmlParserAPIs.j ar in my
    CLASSPATH. Is there another parser defined in my class path somewhere
    or is it something else?

    Thank you!
  • appy77
    New Member
    • Jul 2006
    • 1

    #2
    I have the same problem too :-( , it seems like I can never solve it,

    I dont see any special hidden characters while using JEdit, do you know of an editor for Windows XP, that shows these special characters that are hidden before the prolog?

    heres my xml:

    <?xml version="1.0" encoding="US-ASCII"?>
    <test><value1>v aluex</value1></test>

    heres my jsp:

    <%@ page language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
    <html>
    <head>
    <title></title></head>
    <body>
    <c:import url="test5.xml" var="xml" charEncoding="U S-ASCII"/>
    <x:parse doc="${xml}" varDom="doc" />
    </body>
    </html>

    I tried to substitue the encoding with different values like UTF-8 , others but nothing seems to work!

    please help!

    Comment

    Working...