axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ian_d_stew...@bankone.com
Subject Re: Illegal Namespace prefix: "xml".
Date Mon, 02 Jun 2003 14:11:11 GMT


This makes sense, as 'xml' is a reserved namespace (I believe Anne Thomas
Manes covered this in detail in a previous post).  Perhaps it would be
helpful if the exception message made explicit reference to this?


Ian

Ian D. Stewart
Open Systems Engineer II
Enterprise Midrange - Bank One Infrastructure & Operations
ian_d_stewart@bankone.com
(614) 213-6100




Brian Ewins <Brian.Ewins@btinternet.com> on 06/02/2003 09:53:51 AM

Please respond to axis-user@ws.apache.org

To:   axis-user@ws.apache.org
cc:

Subject:  Re: Illegal Namespace prefix: &quot;xml&quot;.



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" <jpoulsen@metamatrix.com>
> To: <axis-user@ws.apache.org>
> 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:rbadertscher@swissonline.ch]
>>Sent: Monday, June 02, 2003 4:59 AM
>>To: axis-user@xml.apache.org
>>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
>>
>
>
>









This transmission may contain information that is privileged, confidential and/or exempt from
disclosure under applicable law. If you are not the intended recipient, you are hereby notified
that any disclosure, copying, distribution, or use of the information contained herein (including
any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error,
please immediately contact the sender and destroy the material in its entirety, whether in
electronic or hard copy format. Thank you.


Mime
View raw message