You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Aaron Mulder <am...@alumni.princeton.edu> on 2003/10/08 19:37:46 UTC

XML POJO Update (XMLBeans)

	XMLBeans is now in Apache, and I've gotten the Apache version to 
generate, read, and write POJOs for the DDs.  The JAR I built from the 
Apache source is about the same size as Castor, which is not great, but 
1/2 of the pre-Apache version.

	On the down side, it's very slow to read DDs (though writing is 
fast), we need to be able to override the naming convention, there's 
no maven release of the Apache code as far as I can tell, and it barfs on 
the current set of schemas when the Geronimo DDs are included (that one 
may be our fault for mangling namespaces).

	Bottom line, everything seems to be moving in the right direction, 
but there are still some wrinkles left.

Aaron


Re: XML POJO Update (XMLBeans)

Posted by Jacek Laskowski <ja...@hp.com>.
Aaron Mulder wrote:

> 	I have the highest hopes for XMLBeans out of all of the options, 
> which is why I am pursuing it now.  But I'm still not totally convinced 
> that it can be made to work the way we want.

Hi,

Pursuing it even further, let's write down our expectations of what the 
tool ought to do and evaluate one by one. Before we do it, however, we 
need a list of tool's candidates. What I think we could end up with is a 
table with options marked as doable or not. That way I suppose should it 
be fairly easy to pick up the right tool.

> Aaron

Jacek



Re: XML POJO Update (XMLBeans)

Posted by Andy Barnett <ab...@cantilevertech.com>.
According to Commerce One, one of the benefits of XGen is that you
~cannot~ configure the binding process. They argue that since there is
only one non-configurable way for XGen to generate Java from XML, you
can better guarantee what comes out of the binding process. I don't know
how valid that argument is, but that's the gist of it that I got from
their propaganda.

~Andy

On Thu, 2003-10-09 at 14:31, Bruce Snyder wrote:

> This one time, at band camp, Andy Barnett said:
> 
> AB>There's even a comparison already done for you among XGen, Castor, Sun's
> AB>JAXB RI, and Breeze:
> AB>http://www.xml.com/lpt/a/2003/09/03/binding.html
> 
> I spoke to Arnaud Blandin (committer for Castor XML (because I only
> work on Castor JDO)) about this review, and he said that the reason the
> reviewer states that Castor XML doesn't support feature X is because
> she did not configure Castor XML at all.
> 
> Bruce

Re: XML POJO Update (XMLBeans)

Posted by Jason Dillon <ja...@coredevelopers.net>.
> I spoke to Arnaud Blandin (committer for Castor XML (because I only
> work on Castor JDO)) about this review, and he said that the reason the
> reviewer states that Castor XML doesn't support feature X is because
> she did not configure Castor XML at all.

I thought it was that Castor XML does not support XSD fully yet... but 
I can not say for sure.  The only work I have done with Castor XML I 
was writing the XSD too, so could work around any possible problems.

--jason


Re: XML POJO Update (XMLBeans)

Posted by Bruce Snyder <fe...@frii.com>.
This one time, at band camp, Andy Barnett said:

AB>How about XGen from CommerceOne for a XML-Java Binding tool?
AB>http://www.commerceone.com/developers/docsoapxdk/xgen.html

I had no idea that Commerce One is still around. 

AB>There's even a comparison already done for you among XGen, Castor, Sun's
AB>JAXB RI, and Breeze:
AB>http://www.xml.com/lpt/a/2003/09/03/binding.html

I spoke to Arnaud Blandin (committer for Castor XML (because I only
work on Castor JDO)) about this review, and he said that the reason the
reviewer states that Castor XML doesn't support feature X is because
she did not configure Castor XML at all.

Bruce
-- 
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project 
http://www.castor.org/

Apache Geronimo 
http://incubator.apache.org/projects/geronimo.html



Re: XML POJO Update (XMLBeans)

Posted by Andy Barnett <ab...@cantilevertech.com>.
How about XGen from CommerceOne for a XML-Java Binding tool?
http://www.commerceone.com/developers/docsoapxdk/xgen.html

There's even a comparison already done for you among XGen, Castor, Sun's
JAXB RI, and Breeze:
http://www.xml.com/lpt/a/2003/09/03/binding.html

Cheers,
~Andy

On Wed, 2003-10-08 at 16:17, Jacek Laskowski wrote:

> Bruce Snyder wrote:
> 
> > Have we considered the use of JiBx (http://jibx.sourceforge.net/)? I'm
> > seeing small reservations from everyone who looks at XMLBeans. Why not
> > consider other tools that are very well suited to the job?
> 
> That's then the first candidate or the second assuming XMLBeans was the 
> first. We've got two on the table, what about requirements? I don't 
> remember what were the problems with the tools, and although I would 
> probably be able to find it out very easily in the archive, I think that 
> after some time we could change out expectations as well. So, please let 
> me know what we need and Castor or XMLBeans don't provide?
> 
> > Bruce
> 
> Jacek

Re: XML POJO Update (XMLBeans)

Posted by Keith Visco <kv...@intalio.com>.
Hi Arnaud,

That's the not the same bug. The "bug" you are talking about was
introduced in 0.9.5.2, after we switched the Unmarshaller over to use a
SAX XMLReader by default instead of a SAX Parser by default. The bug
they are seeing I believe was fixed back in 0.9.5.1. The two issues are
related, but are different.

The bug they see is that Castor SOM (Schema Object Model) didn't have
automatic support for the XML namespace. The user would have to specify
this namespace to get around the problem. So I added this support in
0.9.5.1. Part of that upgrade was to throw an exception if the user
tried to declare the XML namespace, which according to the XML namespace
spec shouldn't be declared. All of which, worked fine for everyone,
until I switched to use the XMLReader. After upgrading, people started
complaining that Castor was throwing an exception about "xml" is a
reserved prefix and should not be declared. It worked fine under older
versions of Xerces but not under the newer ones. This is because newer
versions of Xerces call the startPrefixMapping("xml",
"http://www.w3.org/XML/1998/namespace") method when they encounter the
namespace prefix on any element (such as xml:lang) (probably for
convenience to the user, but it's still shouldn't happen in my opinion).
The work-around for 0.9.5.2 was to simply enable namespace processing in
the XMLReader. If namespace processing is enabled, Xerces doesn't call
the startPrefixMapping method with the "xml" namespace.  The CVS version
does contain a patch that checks explicitely for the "xml" namespace in
the startPrefixMapping method and simply ignores it, instead of throwing
an exception.

Anyway, since they are using 0.9.5 they are seeing a real Castor bug,
that was fixed a while back.

Just wanted to clear that up...didn't want the Xerces folks getting
blamed for that particular issue.

--Keith

Arnaud Blandin wrote:
> 
> Hi everyone,
> 
> The behavior you are experiencing appeared when we introduced native
> SAX2 support in support. We believed it is a Xerces bug but we checked
> in a workaround in the latest version of Castor (CVS). You can download
> a nightly build that should include that patch.
> Usually the download information of Castor is available at:
> http://www.castor.org/download.html
> I see you guys are using Maven, I think (I am not 100% sure) that Maven
> has an option to check-out the latest release of a jar if you give it a
> URL.
> 
> Concerning the discussion for a Schema Validator; I usually use Castor
> :) (we implement schema validation in an incremental way; meaning that
> we implemented the core of the validation specified in XML Schema spec
> and people give us feedback on what is missing so that we can complete
> our implementation) else I found that XSV
> (www.ltg.ed.ac.uk/~ht/xsv-status.html) written in Python and XML Schema
> Quality Checker from IBM.
> 
> Let me know what we can do for you,
> 
> Arnaud
> 
> > -----Original Message-----
> > From: Jacek Laskowski [mailto:jacek.laskowski@hp.com]
> > Sent: Monday, October 13, 2003 1:16 PM
> > To: geronimo-dev@incubator.apache.org
> > Subject: Re: XML POJO Update (XMLBeans)
> >
> >
> > Keith Visco wrote:
> >
> > >
> > > Aaron Mulder wrote:
> > >
> > >>On Sun, 12 Oct 2003, Jacek Laskowski wrote:
> > >>
> > >>>Once Castor's team joined the mailing list and are ready
> > to work out
> > >>>any issues we've seen so far, who is in charge of deciding whether
> > >>>Castor is the tool of our choice and we cease
> > *immediatelly* writing
> > >>>POJOs and handling mapping between XMLs and them by hand? I (and
> > >>>Aaron seemed
> > >>>also) don't like writing them by hand, so let's hand it
> > over to a tool
> > >>>which is able to deal with it. If the only problem with
> > Castor is the
> > >>>above point, I don't see why Castor wouldn't be used.
> > >>
> > >>        I can certainly drive this decision.
> > >>
> > >>        On this note, does anyone know of an authoritative yet free
> > >>way to validate a schema?  I'm trying to revise our
> > Geronimo schemas
> > >>to get out of the J2EE namespace.  I'm at a point where
> > Sun's "multi
> > >>schema validator" think my working Geronimo schema is valid but
> > >>XMLBeans thinks its not.  I have no idea "who's right".
> > >>
> > >>        As far as Castor goes, every time I try to run Castor on
> > >>J2EE/Geronimo schemas, I get:
> > >>
> > >>namespace 'http://www.w3.org/XML/1998/namespace' not declared in
> > >>schema at
> > >>org.exolab.castor.xml.schema.reader.Sax2ComponentReader.star
> > tElement(S
> > >>ax2ComponentReader.java:256)
> > >>
> > >>        This doesn't seem to be a fatal error, but no code is
> > >>generated either.  Aargh!  :)
> > >
> > >
> > > Hi Aaron,
> > >
> > > Which version of Castor are you using? It doesn't sound
> > like you are
> > > using 0.9.5.2.
> >
> > I don't know about Aaron's build environment, but
> > http://www.ibiblio.org/maven/castor/jars/ has only castor-0.9.5.jar
> >      which seems to not be the one we ought to use, doesn't it?
> >
> > So, the problem boils down to the question how to upload the latest
> > release of Castor?
> >
> > >
> > > Also, feel free to send me one of the schema you are having
> > problems
> > > with and I will take a look at it.
> >
> > The very similar issue you're able to take a look at once is
> > to download
> > Geronimo sources from CVS and while in modules/core run maven
> > build. You
> >    should see something as follows:
> >
> >      [mkdir] Created dir:
> > /disk/home/jacekl/cvs/geronimo/modules/core/target/castor/gen
> >      [echo] Generating sources for
> > /disk/home/jacekl/cvs/geronimo/modules/core/src/schema/geronim
> > o-ejb-jar.xsd
> >      [java] -- Suppressing non fatal warnings.
> >      [java] namespace 'http://www.w3.org/XML/1998/namespace' not
> > declared in schema
> >      [java]      at
> > org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startE
> > lement(Sax2ComponentReader.java:256)
> >      [java]      at
> > org.apache.xerces.parsers.AbstractSAXParser.startElement(Unkno
> > wn Source)
> >      [java]      at
> > org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyEleme
> > nt(Unknown
> > Source)
> >      [java]      at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
> > tElement(Unknown
> > Source)
> >      [java]      at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
> > ContentDispatcher.dispatch(Unknown
> > Source)
> >      [java]      at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> > ment(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.schema.reader.IncludeUnmarshaller.<init>
> > (IncludeUnmarshaller.java:126)
> >      [java]      at
> > org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.startEl
> > ement(SchemaUnmarshaller.java:418)
> >      [java]      at
> > org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startE
> > lement(Sax2ComponentReader.java:253)
> >      [java]      at
> > org.apache.xerces.parsers.AbstractSAXParser.startElement(Unkno
> > wn Source)
> >      [java]      at
> > org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyEleme
> > nt(Unknown
> > Source)
> >      [java]      at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
> > tElement(Unknown
> > Source)
> >      [java]      at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
> > ContentDispatcher.dispatch(Unknown
> > Source)
> >      [java]      at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> > ment(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.builder.SourceGenerator.generateSource(Sourc
> > eGenerator.java:518)
> >      [java]      at
> > org.exolab.castor.builder.SourceGenerator.generateSource(Sourc
> > eGenerator.java:571)
> >      [java]      at
> > org.exolab.castor.builder.SourceGenerator.main(SourceGenerator
> > .java:1126)
> >      [touch] Creating
> > /disk/home/jacekl/cvs/geronimo/modules/core/target/castor/gero
> > nimo-ejb-jar.xsd.tstamp
> >      [echo] Compiling to
> > /disk/home/jacekl/cvs/geronimo/modules/core/target/classes
> >      [javac] Compiling 359 source files to
> > /disk/home/jacekl/cvs/geronimo/modules/core/target/classes
> > Note: Some input files use or override a deprecated API.
> > Note: Recompile with -deprecation for details.
> >
> > I'd bet Aaron sees a very similar message if not alike.
> >
> > >
> > > --Keith
> >
> > Jacek
> >

RE: XML POJO Update (Castor)

Posted by Bruce Snyder <fe...@frii.com>.
This one time, at band camp, Aaron Mulder said:

AM>On Mon, 13 Oct 2003, Arnaud Blandin wrote:
AM>> The behavior you are experiencing appeared when we introduced native
AM>> SAX2 support in support. We believed it is a Xerces bug but we checked
AM>> in a workaround in the latest version of Castor (CVS). You can download
AM>> a nightly build that should include that patch.
AM>> Usually the download information of Castor is available at:
AM>> http://www.castor.org/download.html
AM>> I see you guys are using Maven, I think (I am not 100% sure) that Maven
AM>> has an option to check-out the latest release of a jar if you give it a
AM>> URL.
AM>
AM>	Maven usually downloads files from http://www.ibiblio.org/maven
AM>(in this case http://www.ibiblio.org/maven/castor/jars/).  The most
AM>current version there is 0.9.5.
AM>	Maven has the ability to use a "SNAPSHOT" build, but those also 
AM>appear on the ibiblio site, presumably updated there nightly (see, for 
AM>example, http://www.ibiblio.org/maven/mx4j/jars/), though I'm just 
AM>guessing now.
AM>	So I think someone involved with Castor needs to communicate with 
AM>someone involved with Maven and get a newer build up, and if necessary, 
AM>arrange for SNAPSHOT builds to be put there as well.  I have no idea what 
AM>the process is for that.

Concerning the upload of updated jars to the Maven repository, please
see the following doc from the Maven website:

    http://maven.apache.org/repository-upload.html

Bruce
-- 
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project 
http://www.castor.org/

Apache Geronimo 
http://incubator.apache.org/projects/geronimo.html


RE: XML POJO Update (Castor)

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On Mon, 13 Oct 2003, Arnaud Blandin wrote:
> The behavior you are experiencing appeared when we introduced native
> SAX2 support in support. We believed it is a Xerces bug but we checked
> in a workaround in the latest version of Castor (CVS). You can download
> a nightly build that should include that patch.
> Usually the download information of Castor is available at:
> http://www.castor.org/download.html
> I see you guys are using Maven, I think (I am not 100% sure) that Maven
> has an option to check-out the latest release of a jar if you give it a
> URL.

	Maven usually downloads files from http://www.ibiblio.org/maven
(in this case http://www.ibiblio.org/maven/castor/jars/).  The most
current version there is 0.9.5.
	Maven has the ability to use a "SNAPSHOT" build, but those also 
appear on the ibiblio site, presumably updated there nightly (see, for 
example, http://www.ibiblio.org/maven/mx4j/jars/), though I'm just 
guessing now.
	So I think someone involved with Castor needs to communicate with 
someone involved with Maven and get a newer build up, and if necessary, 
arrange for SNAPSHOT builds to be put there as well.  I have no idea what 
the process is for that.

> Concerning the discussion for a Schema Validator; I usually use Castor
> :) (we implement schema validation in an incremental way; meaning that
> we implemented the core of the validation specified in XML Schema spec
> and people give us feedback on what is missing so that we can complete
> our implementation) else I found that XSV
> (www.ltg.ed.ac.uk/~ht/xsv-status.html) written in Python and XML Schema
> Quality Checker from IBM.

	I'll try those tools on my schema, as well as the most current
Castor release I can find, and let you know how it goes.  But I assume
that I can't check anything in until there's a newer version of Castor on
ibiblio.

Thanks,
	Aaron


RE: XML POJO Update (XMLBeans)

Posted by Arnaud Blandin <bl...@intalio.com>.
Hi everyone,

The behavior you are experiencing appeared when we introduced native
SAX2 support in support. We believed it is a Xerces bug but we checked
in a workaround in the latest version of Castor (CVS). You can download
a nightly build that should include that patch.
Usually the download information of Castor is available at:
http://www.castor.org/download.html
I see you guys are using Maven, I think (I am not 100% sure) that Maven
has an option to check-out the latest release of a jar if you give it a
URL.

Concerning the discussion for a Schema Validator; I usually use Castor
:) (we implement schema validation in an incremental way; meaning that
we implemented the core of the validation specified in XML Schema spec
and people give us feedback on what is missing so that we can complete
our implementation) else I found that XSV
(www.ltg.ed.ac.uk/~ht/xsv-status.html) written in Python and XML Schema
Quality Checker from IBM.

Let me know what we can do for you,

Arnaud

> -----Original Message-----
> From: Jacek Laskowski [mailto:jacek.laskowski@hp.com] 
> Sent: Monday, October 13, 2003 1:16 PM
> To: geronimo-dev@incubator.apache.org
> Subject: Re: XML POJO Update (XMLBeans)
> 
> 
> Keith Visco wrote:
> 
> > 
> > Aaron Mulder wrote:
> > 
> >>On Sun, 12 Oct 2003, Jacek Laskowski wrote:
> >>
> >>>Once Castor's team joined the mailing list and are ready 
> to work out 
> >>>any issues we've seen so far, who is in charge of deciding whether 
> >>>Castor is the tool of our choice and we cease 
> *immediatelly* writing 
> >>>POJOs and handling mapping between XMLs and them by hand? I (and 
> >>>Aaron seemed
> >>>also) don't like writing them by hand, so let's hand it 
> over to a tool
> >>>which is able to deal with it. If the only problem with 
> Castor is the
> >>>above point, I don't see why Castor wouldn't be used.
> >>
> >>        I can certainly drive this decision.
> >>
> >>        On this note, does anyone know of an authoritative yet free 
> >>way to validate a schema?  I'm trying to revise our 
> Geronimo schemas 
> >>to get out of the J2EE namespace.  I'm at a point where 
> Sun's "multi 
> >>schema validator" think my working Geronimo schema is valid but 
> >>XMLBeans thinks its not.  I have no idea "who's right".
> >>
> >>        As far as Castor goes, every time I try to run Castor on 
> >>J2EE/Geronimo schemas, I get:
> >>
> >>namespace 'http://www.w3.org/XML/1998/namespace' not declared in 
> >>schema at 
> >>org.exolab.castor.xml.schema.reader.Sax2ComponentReader.star
> tElement(S
> >>ax2ComponentReader.java:256)
> >>
> >>        This doesn't seem to be a fatal error, but no code is 
> >>generated either.  Aargh!  :)
> > 
> > 
> > Hi Aaron,
> > 
> > Which version of Castor are you using? It doesn't sound 
> like you are 
> > using 0.9.5.2.
> 
> I don't know about Aaron's build environment, but 
> http://www.ibiblio.org/maven/castor/jars/ has only castor-0.9.5.jar 
>      which seems to not be the one we ought to use, doesn't it?
> 
> So, the problem boils down to the question how to upload the latest 
> release of Castor?
> 
> > 
> > Also, feel free to send me one of the schema you are having 
> problems 
> > with and I will take a look at it.
> 
> The very similar issue you're able to take a look at once is 
> to download 
> Geronimo sources from CVS and while in modules/core run maven 
> build. You 
>    should see something as follows:
> 
>      [mkdir] Created dir: 
> /disk/home/jacekl/cvs/geronimo/modules/core/target/castor/gen
>      [echo] Generating sources for 
> /disk/home/jacekl/cvs/geronimo/modules/core/src/schema/geronim
> o-ejb-jar.xsd
>      [java] -- Suppressing non fatal warnings.
>      [java] namespace 'http://www.w3.org/XML/1998/namespace' not 
> declared in schema
>      [java]      at 
> org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startE
> lement(Sax2ComponentReader.java:256)
>      [java]      at 
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unkno
> wn Source)
>      [java]      at 
> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyEleme
> nt(Unknown 
> Source)
>      [java]      at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
> tElement(Unknown 
> Source)
>      [java]      at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
> ContentDispatcher.dispatch(Unknown 
> Source)
>      [java]      at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> ment(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.schema.reader.IncludeUnmarshaller.<init>
> (IncludeUnmarshaller.java:126)
>      [java]      at 
> org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.startEl
> ement(SchemaUnmarshaller.java:418)
>      [java]      at 
> org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startE
> lement(Sax2ComponentReader.java:253)
>      [java]      at 
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unkno
> wn Source)
>      [java]      at 
> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyEleme
> nt(Unknown 
> Source)
>      [java]      at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStar
> tElement(Unknown 
> Source)
>      [java]      at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$Fragment
> ContentDispatcher.dispatch(Unknown 
> Source)
>      [java]      at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocu
> ment(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.builder.SourceGenerator.generateSource(Sourc
> eGenerator.java:518)
>      [java]      at 
> org.exolab.castor.builder.SourceGenerator.generateSource(Sourc
> eGenerator.java:571)
>      [java]      at 
> org.exolab.castor.builder.SourceGenerator.main(SourceGenerator
> .java:1126)
>      [touch] Creating 
> /disk/home/jacekl/cvs/geronimo/modules/core/target/castor/gero
> nimo-ejb-jar.xsd.tstamp
>      [echo] Compiling to 
> /disk/home/jacekl/cvs/geronimo/modules/core/target/classes
>      [javac] Compiling 359 source files to 
> /disk/home/jacekl/cvs/geronimo/modules/core/target/classes
> Note: Some input files use or override a deprecated API.
> Note: Recompile with -deprecation for details.
> 
> I'd bet Aaron sees a very similar message if not alike.
> 
> > 
> > --Keith
> 
> Jacek
> 


Re: XML POJO Update (XMLBeans)

Posted by Jacek Laskowski <ja...@hp.com>.
Keith Visco wrote:

> 
> Aaron Mulder wrote:
> 
>>On Sun, 12 Oct 2003, Jacek Laskowski wrote:
>>
>>>Once Castor's team joined the mailing list and are ready to work out any
>>>issues we've seen so far, who is in charge of deciding whether Castor is
>>>the tool of our choice and we cease *immediatelly* writing POJOs and
>>>handling mapping between XMLs and them by hand? I (and Aaron seemed
>>>also) don't like writing them by hand, so let's hand it over to a tool
>>>which is able to deal with it. If the only problem with Castor is the
>>>above point, I don't see why Castor wouldn't be used.
>>
>>        I can certainly drive this decision.
>>
>>        On this note, does anyone know of an authoritative yet free way to
>>validate a schema?  I'm trying to revise our Geronimo schemas to get out
>>of the J2EE namespace.  I'm at a point where Sun's "multi schema
>>validator" think my working Geronimo schema is valid but XMLBeans thinks
>>its not.  I have no idea "who's right".
>>
>>        As far as Castor goes, every time I try to run Castor on
>>J2EE/Geronimo schemas, I get:
>>
>>namespace 'http://www.w3.org/XML/1998/namespace' not declared in schema
>>at org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startElement(Sax2ComponentReader.java:256)
>>
>>        This doesn't seem to be a fatal error, but no code is generated
>>either.  Aargh!  :)
> 
> 
> Hi Aaron,
> 
> Which version of Castor are you using? It doesn't sound like you are
> using 0.9.5.2.

I don't know about Aaron's build environment, but 
http://www.ibiblio.org/maven/castor/jars/ has only castor-0.9.5.jar 
     which seems to not be the one we ought to use, doesn't it?

So, the problem boils down to the question how to upload the latest 
release of Castor?

> 
> Also, feel free to send me one of the schema you are having problems
> with and I will take a look at it.

The very similar issue you're able to take a look at once is to download 
Geronimo sources from CVS and while in modules/core run maven build. You 
   should see something as follows:

     [mkdir] Created dir: 
/disk/home/jacekl/cvs/geronimo/modules/core/target/castor/gen
     [echo] Generating sources for 
/disk/home/jacekl/cvs/geronimo/modules/core/src/schema/geronimo-ejb-jar.xsd
     [java] -- Suppressing non fatal warnings.
     [java] namespace 'http://www.w3.org/XML/1998/namespace' not 
declared in schema
     [java]      at 
org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startElement(Sax2ComponentReader.java:256)
     [java]      at 
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
     [java]      at 
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown 
Source)
     [java]      at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(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.schema.reader.IncludeUnmarshaller.<init>(IncludeUnmarshaller.java:126)
     [java]      at 
org.exolab.castor.xml.schema.reader.SchemaUnmarshaller.startElement(SchemaUnmarshaller.java:418)
     [java]      at 
org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startElement(Sax2ComponentReader.java:253)
     [java]      at 
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
     [java]      at 
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown 
Source)
     [java]      at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(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.builder.SourceGenerator.generateSource(SourceGenerator.java:518)
     [java]      at 
org.exolab.castor.builder.SourceGenerator.generateSource(SourceGenerator.java:571)
     [java]      at 
org.exolab.castor.builder.SourceGenerator.main(SourceGenerator.java:1126)
     [touch] Creating 
/disk/home/jacekl/cvs/geronimo/modules/core/target/castor/geronimo-ejb-jar.xsd.tstamp
     [echo] Compiling to 
/disk/home/jacekl/cvs/geronimo/modules/core/target/classes
     [javac] Compiling 359 source files to 
/disk/home/jacekl/cvs/geronimo/modules/core/target/classes
Note: Some input files use or override a deprecated API.
Note: Recompile with -deprecation for details.

I'd bet Aaron sees a very similar message if not alike.

> 
> --Keith

Jacek


Re: XML POJO Update (XMLBeans)

Posted by Keith Visco <kv...@intalio.com>.

Aaron Mulder wrote:
> 
> On Sun, 12 Oct 2003, Jacek Laskowski wrote:
> > Once Castor's team joined the mailing list and are ready to work out any
> > issues we've seen so far, who is in charge of deciding whether Castor is
> > the tool of our choice and we cease *immediatelly* writing POJOs and
> > handling mapping between XMLs and them by hand? I (and Aaron seemed
> > also) don't like writing them by hand, so let's hand it over to a tool
> > which is able to deal with it. If the only problem with Castor is the
> > above point, I don't see why Castor wouldn't be used.
> 
>         I can certainly drive this decision.
> 
>         On this note, does anyone know of an authoritative yet free way to
> validate a schema?  I'm trying to revise our Geronimo schemas to get out
> of the J2EE namespace.  I'm at a point where Sun's "multi schema
> validator" think my working Geronimo schema is valid but XMLBeans thinks
> its not.  I have no idea "who's right".
> 
>         As far as Castor goes, every time I try to run Castor on
> J2EE/Geronimo schemas, I get:
> 
> namespace 'http://www.w3.org/XML/1998/namespace' not declared in schema
> at org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startElement(Sax2ComponentReader.java:256)
> 
>         This doesn't seem to be a fatal error, but no code is generated
> either.  Aargh!  :)

Hi Aaron,

Which version of Castor are you using? It doesn't sound like you are
using 0.9.5.2.

Also, feel free to send me one of the schema you are having problems
with and I will take a look at it.

--Keith

Re: XML POJO Update (XMLBeans)

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On Sun, 12 Oct 2003, Jacek Laskowski wrote:
> Once Castor's team joined the mailing list and are ready to work out any 
> issues we've seen so far, who is in charge of deciding whether Castor is 
> the tool of our choice and we cease *immediatelly* writing POJOs and 
> handling mapping between XMLs and them by hand? I (and Aaron seemed 
> also) don't like writing them by hand, so let's hand it over to a tool 
> which is able to deal with it. If the only problem with Castor is the 
> above point, I don't see why Castor wouldn't be used.

	I can certainly drive this decision.

	On this note, does anyone know of an authoritative yet free way to
validate a schema?  I'm trying to revise our Geronimo schemas to get out
of the J2EE namespace.  I'm at a point where Sun's "multi schema
validator" think my working Geronimo schema is valid but XMLBeans thinks
its not.  I have no idea "who's right".

	As far as Castor goes, every time I try to run Castor on 
J2EE/Geronimo schemas, I get:

namespace 'http://www.w3.org/XML/1998/namespace' not declared in schema
at org.exolab.castor.xml.schema.reader.Sax2ComponentReader.startElement(Sax2ComponentReader.java:256)

	This doesn't seem to be a fatal error, but no code is generated 
either.  Aargh!  :)

Aaron


Re: XML POJO Update (XMLBeans)

Posted by Jacek Laskowski <ja...@hp.com>.
Bruce Snyder wrote:
> Jacek,
> 
> Some very good points, Jacek. Just today both Arnaud and Keith from
> the Castor Project (committers and architects for Castor XML) have
> joined the geronimo-dev list.

Excellent! Welcome on board, guys.

> Each of them told me that Castor XML supports the full XML Schema
> as well as nearly all of the requirements set forth by Aaron.  If
> there are any additional features we'd like to have in Castor XML
> that they are extremely willing to add those features to Castor XML
> in a high priority manner.
> 
> JL>AM>the tool must write DDs with namespace indicators (reading and then
> JL>AM>rewriting a DD should not lose information in the document element or
> JL>AM>header)
> 
> The requirement listed above by Aaron has already been discussed
> amongst Arnaud, Keith and I and we're talking about some options.
> 
> Let's discuss anything other questions people may have about Castor
> XML so that Arnaud and Keith can jump in and lend a hand in answering
> them and helping out with any issues that may arise.

Once Castor's team joined the mailing list and are ready to work out any 
issues we've seen so far, who is in charge of deciding whether Castor is 
the tool of our choice and we cease *immediatelly* writing POJOs and 
handling mapping between XMLs and them by hand? I (and Aaron seemed 
also) don't like writing them by hand, so let's hand it over to a tool 
which is able to deal with it. If the only problem with Castor is the 
above point, I don't see why Castor wouldn't be used.

Although I'd read many times on this list that anybody may begin a vote, 
I would like to see it done by someone from the team.

> Bruce

Jacek


Re: XML POJO Update (XMLBeans)

Posted by Bruce Snyder <fe...@frii.com>.
This one time, at band camp, Jacek Laskowski said:

JL>Aaron Mulder wrote:
JL>
JL>> 	My sense is that none of the tools is a "perfect fit" out of the
JL>> box, so it's just a matter of working through the necessary
JL>> customizations.  I think I'm quite close to being satisfied with XMLBeans
JL>> -- I suspect I just need to straighten out our Geronimo namespace and then
JL>> wait for the XMLBeans project to put something in the Maven repository.
JL>> 	But just to state my requirements, here's what I can think up off
JL>> the top of my head:
JL>
JL>Hi,
JL>
JL>Since Geronimo "is bringing together leading members of the Castor,
JL>JBoss, MX4J and OpenEJB communities" I couldn't believe we couldn't
JL>start with Castor as the best fit (even if it's not already). If
JL>there're something missing in the tool I'd bet it's going the highest
JL>priority to fix it as the tool's members are also Geronimo ones, and who
JL>else would support it better. XMLBeans is incubating and the jar's size
JL>is equals to the one of Castor, so unless there're features in XMLBeans
JL>that outweighs the ones found in Castor I wouldn't even bother to take a
JL>look at XMLBeans. Although, I remember I had some problems with XSD of
JL>standard DDs, but did manage to work them out very quickly.
JL>
JL>So, hey, Castor's members, wouldn't you mind to comment on the
JL>requirements Aaron was kind to write down? Otherwise, I'll have to
JL>figure out if Castor does what Aaron is expecting from the tool (and it
JL>will certainly take some time).

Jacek,

Some very good points, Jacek. Just today both Arnaud and Keith from
the Castor Project (committers and architects for Castor XML) have
joined the geronimo-dev list.

Each of them told me that Castor XML supports the full XML Schema
as well as nearly all of the requirements set forth by Aaron.  If
there are any additional features we'd like to have in Castor XML
that they are extremely willing to add those features to Castor XML
in a high priority manner.

JL>AM>the tool must write DDs with namespace indicators (reading and then
JL>AM>rewriting a DD should not lose information in the document element or
JL>AM>header)

The requirement listed above by Aaron has already been discussed
amongst Arnaud, Keith and I and we're talking about some options.

Let's discuss anything other questions people may have about Castor
XML so that Arnaud and Keith can jump in and lend a hand in answering
them and helping out with any issues that may arise.

Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project
http://www.castor.org/

Apache Geronimo
http://incubator.apache.org/projects/geronimo.html

Re: XML POJO Update (XMLBeans)

Posted by Jacek Laskowski <ja...@hp.com>.
Aaron Mulder wrote:

> 	My sense is that none of the tools is a "perfect fit" out of the 
> box, so it's just a matter of working through the necessary 
> customizations.  I think I'm quite close to being satisfied with XMLBeans 
> -- I suspect I just need to straighten out our Geronimo namespace and then 
> wait for the XMLBeans project to put something in the Maven repository.
> 	But just to state my requirements, here's what I can think up off 
> the top of my head:

Hi,

Since Geronimo "is bringing together leading members of the Castor, 
JBoss, MX4J and OpenEJB communities" I couldn't believe we couldn't 
start with Castor as the best fit (even if it's not already). If 
there're something missing in the tool I'd bet it's going the highest 
priority to fix it as the tool's members are also Geronimo ones, and who 
else would support it better. XMLBeans is incubating and the jar's size 
is equals to the one of Castor, so unless there're features in XMLBeans 
that outweighs the ones found in Castor I wouldn't even bother to take a 
look at XMLBeans. Although, I remember I had some problems with XSD of 
standard DDs, but did manage to work them out very quickly.

So, hey, Castor's members, wouldn't you mind to comment on the 
requirements Aaron was kind to write down? Otherwise, I'll have to 
figure out if Castor does what Aaron is expecting from the tool (and it 
will certainly take some time).

Cheers,
Jacek


Re: XML POJO Update (XMLBeans)

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
	My sense is that none of the tools is a "perfect fit" out of the 
box, so it's just a matter of working through the necessary 
customizations.  I think I'm quite close to being satisfied with XMLBeans 
-- I suspect I just need to straighten out our Geronimo namespace and then 
wait for the XMLBeans project to put something in the Maven repository.
	But just to state my requirements, here's what I can think up off 
the top of my head:

 - the tool must be able to process the full set of J2EE XSDs, including 
EAR, Web, JSP, Taglib, EJB, RAR, web services, web services client, 
application client

 - we must be able to customize the translation of XML elements to POJO 
packages & class names

 - the tool should be reasonably fast (fraction of a second to parse DD)

 - the smaller the tool JAR the better

 - the tool should not rely on any 3rd party JARs/libraries, including 
any specific XML parser

 - the generated code should have getters and setters returning strings 
for elements that just contain text values (i.e. getEjbName() for the 
"ejb-name" child of an EJB element)

 - XPath support is a big bonus

 - the tool must be able to read and write DDs from the command-line 
deployer without any onerous configuration

 - the tool must write DDs with namespace indicators (reading and then 
rewriting a DD should not lose information in the document element or 
header)

 - the tool should write human-readable DDs (not all on one line, use 
indentation, not unnecessary CDATA wrappers)

 - ideally, the tool would not refuse to load an incomplete document (such 
as omitting the version attribute in the document element), such that we 
could load a EJB 2.0 DD with the code generated for EJB 2.1 (not sure how 
realistic this is)

 - the tool should be available via maven, so we don't need to manually 
add the JAR to our build tree

 - ideally, the tool would generate base classes or interfaces for 
elements with common content groups (JNDI environment refs group, 
description group)

Aaron

On Wed, 8 Oct 2003, Jacek Laskowski wrote:
> > Have we considered the use of JiBx (http://jibx.sourceforge.net/)? I'm
> > seeing small reservations from everyone who looks at XMLBeans. Why not
> > consider other tools that are very well suited to the job?
> 
> That's then the first cadidate or the second assuming XMLBeans was the 
> first. We've got two on the table, what about requirements? I don't 
> remember what were the problems with the tools, and although I would 
> probably be able to find it out very easily in the archive, I think that 
> after some time we could change out expectations as well. So, please let 
> me know what we need and Castor or XMLBeans don't provide?



Re: XML POJO Update (XMLBeans)

Posted by Jacek Laskowski <ja...@hp.com>.
Bruce Snyder wrote:

> Have we considered the use of JiBx (http://jibx.sourceforge.net/)? I'm
> seeing small reservations from everyone who looks at XMLBeans. Why not
> consider other tools that are very well suited to the job?

That's then the first cadidate or the second assuming XMLBeans was the 
first. We've got two on the table, what about requirements? I don't 
remember what were the problems with the tools, and although I would 
probably be able to find it out very easily in the archive, I think that 
after some time we could change out expectations as well. So, please let 
me know what we need and Castor or XMLBeans don't provide?

> Bruce

Jacek


Re: XML POJO Update (XMLBeans)

Posted by Bruce Snyder <fe...@frii.com>.
This one time, at band camp, Aaron Mulder said:

AM>On Wed, 8 Oct 2003, Jacek Laskowski wrote:
AM>> Does it mean that we're considering it as a tool to handle our XML files
AM>> ? I thought we'd agreed that the files were to be parsed by our own
AM>> code. Would it be changed in the future? When? I doubt if we keep
AM>> writing the code ourselves nobody will ever want to rewrite them to use
AM>> the tool.
AM>
AM>	I think that many people (myself included) would like to be using 
AM>a tool rather than writing things ourselves.  As of the last time this was 
AM>considered, none of the tools really did the job, so we decided to do it 
AM>ourselves in the short term.

I definitely agree (but, of course, I'm part of The Castor Project ;-)).
There's a lot to be said for reusing well built tools that are already
available. In fact, we need to continually check ourselves so that we're
not pervasive with the 'Not Built Here' attitude.

Have we considered the use of JiBx (http://jibx.sourceforge.net/)? I'm
seeing small reservations from everyone who looks at XMLBeans. Why not
consider other tools that are very well suited to the job?

Bruce
-- 
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project 
http://www.castor.org/

Apache Geronimo 
http://incubator.apache.org/projects/geronimo.html


Re: XML POJO Update (XMLBeans)

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
On Wed, 8 Oct 2003, Jacek Laskowski wrote:
> Does it mean that we're considering it as a tool to handle our XML files
> ? I thought we'd agreed that the files were to be parsed by our own
> code. Would it be changed in the future? When? I doubt if we keep
> writing the code ourselves nobody will ever want to rewrite them to use
> the tool.

	I think that many people (myself included) would like to be using 
a tool rather than writing things ourselves.  As of the last time this was 
considered, none of the tools really did the job, so we decided to do it 
ourselves in the short term.

	For my 2 cents, I don't want to use a tool unless we can configure
the output to be fairly similar to what we can/did code by hand.  That's
one of the issues I'm still working through.  The main advantage of a tool
is that though the hand-coded POJOs are pretty nice and user-friendly, it
is fairly painful to write all the code necessary to both read and write
each of the 12+ files we're talking about here (that's DDs only, not the
Twiddle or kernel config files).  Right now I think we have code to read 7
of the 12 and write 2 of the 12 files, and that's after a fairly
significant effort.  As well, the hand written POJOs will be difficult to
keep accurate and up to date as the schemas change (right now the Geronimo
extensions are pretty minimal, but the volume of DD elements for all the
other app server suggests that there will be significant growth here).

> What about picking up one (e.g. XMLBeans) and dealing with its pros and
> cons or just create a service that does the job for us, i.e. reads the
> DDs (or any other XMLs) and provides POJOs? I don't have any idea how
> long it would take, but it's worth at least to talk about it (again).

	I have the highest hopes for XMLBeans out of all of the options, 
which is why I am pursuing it now.  But I'm still not totally convinced 
that it can be made to work the way we want.

	As far as a service goes, this is really a development-time tool.  
We're going to be compiling code against the beans, so we can't have them 
generated on the fly at runtime or something.  That being the case, a 
layer of abstraction over the selected bean generator doesn't seem all 
that useful to me...

Aaron


Re: XML POJO Update (XMLBeans)

Posted by Jacek Laskowski <ja...@hp.com>.
Aaron Mulder wrote:
...
> 	Bottom line, everything seems to be moving in the right direction, 
> but there are still some wrinkles left.

Hi Aaron,

Does it mean that we're considering it as a tool to handle our XML files
? I thought we'd agreed that the files were to be parsed by our own
code. Would it be changed in the future? When? I doubt if we keep
writing the code ourselves nobody will ever want to rewrite them to use
the tool.

What about picking up one (e.g. XMLBeans) and dealing with its pros and
cons or just create a service that does the job for us, i.e. reads the
DDs (or any other XMLs) and provides POJOs? I don't have any idea how
long it would take, but it's worth at least to talk about it (again).

> Aaron

Jacek