geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Keith Visco <kvi...@intalio.com>
Subject Re: New (0.9.5.2) Castor Error
Date Thu, 16 Oct 2003 20:43:07 GMT

Hi Aaron,

There is a default one in the jar
(/org/exolab/castor/castor.properties).

You can update it in a number of ways:

1. You can update the file in the castor jar itself

-or-

2.  You can place a copy in any jar file under the above path
(org/exolab/castor) or at the root level of the jar, as long as that jar
file appears before the castor jar in the classpath. It doesn't have to
be in a jar, it could be in a directory that's listed in your classpath
as well.

-or-

3. You can place a copy of the file in your working directory 


You could also just grab the latest CVS source that contains the patch
to "ignore" any attempts to map the "xml" prefix instead of throw an
exception. Not sure if Maven lets you grab the source code or not, I
think Arnaud was looking into the Maven stuff.


--Keith

   



Aaron Mulder wrote:
> 
>         I don't see a "castor.properties" file -- is it in the JAR or
> something?  If I need to create one, where do I put it?
> 
> Thanks,
>         Aaron
> 
> On Thu, 16 Oct 2003, Keith Visco wrote:
> > Hi Aaron,
> >
> > This is the issue Arnaud was talking about in his previous post. It
> > happens with newer versions of Xerces, but not the older ones. Xerces is
> > calling the "startPrefixMapping" method with the "xml" prefix.
> > Personally I don't think they should be doing that, but they are, so we
> > checked in some code to ignore the mapping in the Castor CVS.
> >
> > For more information you can see this thread:
> >
> > http://www.mail-archive.com/castor-dev%40exolab.org/msg15353.html
> >
> > There is a simple workaround for Castor 0.9.5.2, just enable namespace
> > processing on the parser in the castor.properties file.
> >
> > in the castor.properties file change the following line:
> >
> >       org.exolab.castor.parser.namespaces=false
> >
> >       to:
> >
> >       org.exolab.castor.parser.namespaces=true
> >
> >
> > --Keith
> >
> >
> > Aaron Mulder wrote:
> > >
> > >         I tried Castor 0.9.5.2 on my DD Schemas, and I get the stack trace
> > > below.  The error is complaining that I've tried to map "xml" as a
> > > namespace, but I'm pretty sure I haven't -- I've looked through the files
> > > and grepped for "xmlns:xml" and "xml=" and so on and found nothing.  If
> > > someone from Castor wants me to send them the schemas for further
> > > investigation, I'd be happy to.  It would really help to get a file name
> > > and line number in these errors!
> > >
> > > Thanks,
> > >         Aaron
> > >
> > >     [echo] Generating sources for
> > > /home/ammulder/cvs/geronimo/modules/xbeans/src/schema/geronimo-application-client.xsd
> > >     [java] -- Disabling generation of Marshalling framework methods
> > > (marshall, unmarshall, validate).
> > >     [java] Exception in thread "main" java.lang.IllegalArgumentException:
> > > The prefix 'xml' is reserved (XML 1.0 Specification) and cannot be
> > > declared.
> > >     [java]      at
> > > org.exolab.castor.xml.Namespaces.addNamespace(Namespaces.java:130)
> > >     [java]      at
> > > org.exolab.castor.xml.UnmarshalHandler.startPrefixMapping(UnmarshalHandler.java:1953)
> > >     [java]      at
> > > org.apache.xerces.parsers.AbstractSAXParser.startNamespaceMapping(Unknown
> > > Source)
> > >     [java]      at
> > > org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
> > >     [java]      at
> > > org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
> > >     [java]      at
> > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> > > Source)
> > >     [java]      at
> > > org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown
> > > Source)
> > >     [java]      at
> > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> > > Source)
> > >     [java]      at
> > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> > > Source)
> > >     [java]      at
> > > org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> > >     [java]      at
> > > org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
> > >     [java]      at org.apache.xerces.parsers.XMLParser.parse(Unknown
> > > Source)
> > >     [java]      at
> > > org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> > >     [java]      at
> > > org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:583)
> > >     [java]      at
> > > org.exolab.castor.builder.binding.BindingLoader.loadBinding(BindingLoader.java:130)
> > >     [java]      at
> > > org.exolab.castor.builder.binding.BindingLoader.createBinding(BindingLoader.java:250)
> > >     [java]      at
> > > org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:746)
> >

Mime
View raw message