I took a look at the crimson code causing this, its a bit odd. The exception being thrown is complaining about an illegal namespace declaration, not an illegal use of a namespace. (in Parser2.java)

if (attQName.startsWith("xmlns")) {
            // Could be a namespace declaration
....
if (!nsSupport.declarePrefix(prefix, value)) {
                error("P-083", new Object[] { prefix });
            }

My reading of all this is that the attribute named "xmlns:xml" is being read by the parser. Searching on google for similar error reports, it seems that every last one of them had extra xmlns:xml declarations; it seems crimson is ok with uses of xml: prefixes but barfs if you try to re-declare it.

This would suggest that the SOAP message causing the errors isn't the one Reto originally sent?

-Baz


Anne Thomas Manes wrote:


Per the XML spec[1], xml:lang is a special attribute. It is acceptable in
any XML document, and you aren't required to declare the xml: namespace
prefix. In fact, "xml" is a reserved namespace prefix name, so you can't
declare it. (Note that the error message is a SAX exception, and that it
says that the xml: prefix is "illegal" not "undeclared"). The schema that
defines <message> should declare the attribute (<xsd:attribute
ref="xml:lang" /> ), but I don't think that really matters in this case.

I'd say that this looks like a bug -- possibly in Crimson. It shouldn't barf
on the xml:lang attribute.

[1] http://www.w3.org/TR/REC-xml#sec-lang-tag

Anne

----- Original Message -----
From: "Jim Poulsen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 02, 2003 7:50 AM
Subject: RE: Illegal Namespace prefix: &quot;xml&quot;.



It appears that whomever is sending you this message is incorrectly

creating


it. The excerpt:

<message xml:lang="de-CH">
               null
           </message>

Contains a reference to a namespace prefix 'xml' which does not appear to

be


a 'defined' namespace for the document.



-----Original Message-----
From: Reto Badertscher [mailto:[EMAIL PROTECTED]
Sent: Monday, June 02, 2003 4:59 AM
To: [EMAIL PROTECTED]
Subject: Illegal Namespace prefix: &quot;xml&quot;.


Hello, i get the following error:

Exception in thread "main" AxisFault
faultCode:

{http://schemas.xmlsoap.org/soap/envelope/}Server.userException


faultSubcode:
faultString: org.xml.sax.SAXException: Error: URI=null Line=3: Illegal
Namespace prefix: &quot;xml&quot;.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException:
Error:
URI=null Line=3: Illegal Namespace prefix: &quot;xml&quot;.
at
org.apache.axis.utils.XMLUtils$ParserErrorHandler.error(XMLUtils.java:619)
at org.apache.crimson.parser.Parser2.error(Parser2.java:3165)
at
org.apache.crimson.parser.Parser2.processAttributeNS(Parser2.java:1588)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1436)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at


org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:1


85)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:322)
at


org.apache.axis.message.MessageElement.getAsDocument(MessageElement.java:684


)
at
org.apache.axis.message.MessageElement.getAsDOM(MessageElement.java:710)
at


org.apache.axis.message.SOAPFaultBuilder.onEndChild(SOAPFaultBuilder.java:32


7)
at


org.apache.axis.encoding.DeserializationContextImpl.endElement(Deserializati


onContextImpl.java:1004)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at


org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationCon


textImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:377)
at org.apache.axis.client.Call.invokeEngine(Call.java:2545)
at org.apache.axis.client.Call.invoke(Call.java:2515)
at org.apache.axis.client.Call.invoke(Call.java:2210)
at org.apache.axis.client.Call.invoke(Call.java:2133)
at org.apache.axis.client.Call.invoke(Call.java:1656)
at


demo.bc.bank.detail.TestBindingStub.bank_get_detail(TestBindingStub.java:164


)
at demo.BankDetailClient.main(BankDetailClient.java:32)


org.xml.sax.SAXException: Error: URI=null Line=3: Illegal Namespace

prefix:


"xml".
at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:543)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:377)
at org.apache.axis.client.Call.invokeEngine(Call.java:2545)
at org.apache.axis.client.Call.invoke(Call.java:2515)
at org.apache.axis.client.Call.invoke(Call.java:2210)
at org.apache.axis.client.Call.invoke(Call.java:2133)
at org.apache.axis.client.Call.invoke(Call.java:1656)
at


demo.bc.bank.detail.TestBindingStub.bank_get_detail(TestBindingStub.java:164


)
at demo.BankDetailClient.main(BankDetailClient.java:32)
Caused by: org.xml.sax.SAXException: Error: URI=null Line=3: Illegal
Namespace
prefix: "xml".
at
org.apache.axis.utils.XMLUtils$ParserErrorHandler.error(XMLUtils.java:619)
at org.apache.crimson.parser.Parser2.error(Parser2.java:3165)
at
org.apache.crimson.parser.Parser2.processAttributeNS(Parser2.java:1588)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1436)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at


org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:1


85)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:322)
at


org.apache.axis.message.MessageElement.getAsDocument(MessageElement.java:684


)
at
org.apache.axis.message.MessageElement.getAsDOM(MessageElement.java:710)
at


org.apache.axis.message.SOAPFaultBuilder.onEndChild(SOAPFaultBuilder.java:32


7)
at


org.apache.axis.encoding.DeserializationContextImpl.endElement(Deserializati


onContextImpl.java:1004)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1528)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.content(Parser2.java:1779)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1507)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at


org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationCon


textImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
... 8 more


when receiving this message from calling a webservice: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/1999/XMLSchema";> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Client</faultcode> <faultstring>[B2BSERV.0088.9134] Exception occurred while processing

the


body of the message</faultstring>
   <faultactor>http://193.5.125.246/soap/rpc</faultactor>
   <detail xmlns="http://www.webmethods.com/2001/10/soap/";>
       <exception>
           <className>java.lang.NullPointerException</className>
           <message xml:lang="de-CH">
               null
           </message>

       </exception>
   </detail>
  </SOAP-ENV:Fault>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Can someone please give me a hint how to prevent this error?

Thanks a lot for any help

Reto Badertscher







Reply via email to