Java Castor Exception : The prefix 'xml' is reserved

C

Christophe Geraud

I got the following exception with Castor: "The prefix 'xml' is reserved
(XML 1.0 Specification) and cannot be declared."
I got this exception using or not a mapping file.
Can anyone tell what it means ?

Here is the stack trace :

java.lang.IllegalArgumentException: The prefix 'xml' is reserved (XML 1.0
Specification) and cannot be declared.

at org.exolab.castor.xml.Namespaces.addNamespace(Namespaces.java:130)

at
org.exolab.castor.xml.UnmarshalHandler.startPrefixMapping(UnmarshalHandler.j
ava:1953)

at
org.apache.xerces.parsers.AbstractSAXParser.startNamespaceMapping(Unknown
Source)

at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)

at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unkno
wn Source)

at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElem
entHook(Unknown Source)

at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)

at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:583)

at org.exolab.castor.mapping.Mapping.loadMappingInternal(Mapping.java:515)

at org.exolab.castor.mapping.Mapping.loadMappingInternal(Mapping.java:468)

at org.exolab.castor.mapping.Mapping.loadMapping(Mapping.java:395)

at Test.main(Test.java:41)

Exception in thread "main"
 
M

Martin Boehm

I got the following exception with Castor: "The prefix 'xml' is
reserved (XML 1.0 Specification) and cannot be declared."

Not knowing your source I can only guess:
You try to insert <xml:foo> elements?

Martin
 
C

Christophe Geraud

Martin Boehm said:
Not knowing your source I can only guess:
You try to insert <xml:foo> elements?

Martin

Thanks for answering.
It seems that it came from the classpath (I use JBuilder).
I create a new set of libraries with Castor 9.5.2.0 & Xerces ... and now it
is ok !! ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top