By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,650 Members | 1,785 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,650 IT Pros & Developers. It's quick & easy.

Content is not allowed in prolog

P: n/a
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.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Content is not allowed in
prolog.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown
Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:3 45)
at org.apache.axis.encoding.DeserializationContextImp l.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.ja va:376)
at org.apache.axis.client.Call.invokeEngine(Call.java :2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at samples.userguide.example2.CalcClient.main(CalcCli ent.java:98)
org.xml.sax.SAXParseException: Content is not allowed in prolog.
at org.apache.axis.AxisFault.makeFault(AxisFault.java :129)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.java:543)
at org.apache.axis.Message.getSOAPEnvelope(Message.ja va:376)
at org.apache.axis.client.Call.invokeEngine(Call.java :2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at samples.userguide.example2.CalcClient.main(CalcCli ent.java:98)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in
prolog.
at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown
Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:3 45)
at org.apache.axis.encoding.DeserializationContextImp l.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPar t.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.jar in my
CLASSPATH. Is there another parser defined in my class path somewhere
or is it something else?

Thank you!
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: 1
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>valuex</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="US-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!
Jul 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.