Ant problems with XJC, JAXB [message #117187] |
Sat, 15 November 2003 01:20  |
Eclipse User |
|
|
|
Originally posted by: srk-nospam.cs.berkeley.edu
Hi,
I'm having some difficulty using XJC and JAXB with Eclipse 3.0M4 (same
problems in 2.1.1). Ant is used to invoke xjc, and compile an xsd file to
Java files. From a command prompt it works great. From Eclipse ant fails,
with the error:
---
[xjc] [WARNING] Unable to validate your schema. Most likely, the JVM has
loaded an incompatible XML parser implementation. You should fix this
before relying on the generated code. Please see the release notes for
details.
[xjc] unknown location
BUILD FAILED: unable to parse the schema. Error messages should have been
provided
---
I believe this is because it is using Eclipse's ant rather than the ant
C:\jwsdp-1.3\apache-ant. I have seen a few newsgroup posts about ant and
Eclipse, but none seem to directly address this problem. Two questions:
1) Am I correct in believing that the above problem is because I am using
the wrong ant?
2) Can Eclipse be configured to use the JWSDP ant? If so, how?
I'm on WinXP, using J2SE 1.4.2 and JWSDP 1.3.
Thanks very much!
+Scott Klemmer
UC Berkeley Group for User Interface Research
|
|
|
Re: Ant problems with XJC, JAXB [message #117844 is a reply to message #117187] |
Mon, 17 November 2003 18:13   |
Eclipse User |
|
|
|
Scott,
Eclipse has some hard dependencies on using the Xerces plugin (XML parser
implementation) provided with eclipse and this may be the cause of your
problems. We are working on cleaning this up for M5.
Now some questions:
What version of Ant is found at C:\jwsdp-1.3\apache-ant?
Have you modified you Ant runtime classpath to include any Xerces
implementations? If so remove them and check out the Eclipse Readme, Known
Issues: Ant section for the full details on this issue.
Now the good news.
You can point Eclipse to use any Ant install by setting the Ant home
location either globally on the Ant runtime classpath preference or you can
set it for each Ant launch configuration on the classpath tab. Again you
will need to ensure no Xerces on the classpath.
HTH
Darins
"Scott Klemmer" <srk-nospam@cs.berkeley.edu> wrote in message
news:bp4gj1$l95$1@eclipse.org...
> Hi,
> I'm having some difficulty using XJC and JAXB with Eclipse 3.0M4 (same
> problems in 2.1.1). Ant is used to invoke xjc, and compile an xsd file to
> Java files. From a command prompt it works great. From Eclipse ant fails,
> with the error:
> ---
> [xjc] [WARNING] Unable to validate your schema. Most likely, the JVM has
> loaded an incompatible XML parser implementation. You should fix this
> before relying on the generated code. Please see the release notes for
> details.
> [xjc] unknown location
> BUILD FAILED: unable to parse the schema. Error messages should have been
> provided
> ---
> I believe this is because it is using Eclipse's ant rather than the ant
> C:\jwsdp-1.3\apache-ant. I have seen a few newsgroup posts about ant and
> Eclipse, but none seem to directly address this problem. Two questions:
> 1) Am I correct in believing that the above problem is because I am using
> the wrong ant?
> 2) Can Eclipse be configured to use the JWSDP ant? If so, how?
>
> I'm on WinXP, using J2SE 1.4.2 and JWSDP 1.3.
>
> Thanks very much!
> +Scott Klemmer
> UC Berkeley Group for User Interface Research
>
|
|
|
|
|
Re: Ant problems with XJC, JAXB [message #118129 is a reply to message #117896] |
Tue, 18 November 2003 16:54   |
Eclipse User |
|
|
|
Originally posted by: srk-nospam.cs.berkeley.edu
Thanks Darin!
Based on your response, I raw some tests and learned a few things:
1) If I delete the xercesImpl included with jwsdp, then ant fails from the
command line, yielding the "Unable to validate" error. If I add Elcipse's
xercesImpl (C:\Program Files\eclipse\plugins\org.apache.xerces_4.0.13) to
the classpath, ant on the command line still fails with the same error.
2) If I delete the xercesImpl included with jwsdp, running ant from within
Eclipse still fails.
3) If I use ant1.6b2, it works great from the command line as long as I
keep the xercesImpl that comes with it. Deleting that xercesImpl.jar also
causes ant1.6b2 to fail.
My current belief is that either new versions of ant or xjc don't like the
xercesImpl that comes with Eclipse. Does this make sense? If so, it seems
my only solution is to wait for M5, and then reconfigure Eclipse to use
the xercesImpl that the newer ant likes?
Am I right, or is there something else I should try? Thanks again for all
the help,
+scott
Darin Swanson wrote:
> Your classpath looks correct.
> Are there any other JARs living in C:/jwsdp-1.3/apache-ant/?
> Both ant.jar and optional.jar from Ant 1.5.4 have manifest files with
> classpath entries that will cause Xerces JARs co-located with these JARs to
> be loaded by a URLClassLoader (even though they are not directed added to
> the Ant runtime classpath)...and this breaks within Eclipse. The solution is
> to ensure that no Xerces JARs are in the same physical location as the
> ant.jar and optional.jar.
> Note that Ant 1.6 has removed these pesky classpath entries in the manifest
> files.
> HTH
> Darins
> "Scott Klemmer" <srk-nospam@cs.berkeley.edu> wrote in message
> news:bpc2is$rjp$1@eclipse.org...
> > Thanks for the help! I'm looking forward to M5...
> >
> > > What version of Ant is found at C:jwsdp-1.3apache-ant?
> >
> > I'm using Apache Ant version 1.5.4
> >
> > > Have you modified you Ant runtime classpath to include any Xerces
> > > implementations? If so remove them and check out the Eclipse Readme,
> Known
> > > Issues: Ant section for the full details on this issue.
> >
> > My ant runtime classpath contains three entries:
> > C:/jwsdp-1.3/apache-ant/ant.jar
> > C:/jwsdp-1.3/apache-ant/optional.jar
> > C:/j2sdk1.4.2/lib/tools.jar
> >
> > Is this correct?
> >
> > > You can point Eclipse to use any Ant install by setting the Ant home
> > > location either globally on the Ant runtime classpath preference or you
> can
> > > set it for each Ant launch configuration on the classpath tab. Again you
> > > will need to ensure no Xerces on the classpath.
> >
> > In Window-Preferences, I've set my ant home to be C:jwsdp-1.3apache-ant.
> > I took a screenshot of my ant settings and put it at
> > http://www.cs.berkeley.edu/~srk/ant.gif
> >
> > Any thoughts on how to fix the validation error?
> > +scott
> >
|
|
|
Re: Ant problems with XJC, JAXB [message #118141 is a reply to message #118129] |
Tue, 18 November 2003 17:22  |
Eclipse User |
|
|
|
Your findings jive with what I know.
Your other choice is to:
make a backup of the Xerces JARs that come with Eclipse
delete these JARs from the Eclipse Xerces plugin
place the Xerces JARs you would like to use in the Eclipse Xerces plugin
HTH
Darins
"Scott Klemmer" <srk-nospam@cs.berkeley.edu> wrote in message
news:bpe4f1$bl1$1@eclipse.org...
> Thanks Darin!
> Based on your response, I raw some tests and learned a few things:
>
> 1) If I delete the xercesImpl included with jwsdp, then ant fails from the
> command line, yielding the "Unable to validate" error. If I add Elcipse's
> xercesImpl (C:\Program Files\eclipse\plugins\org.apache.xerces_4.0.13) to
> the classpath, ant on the command line still fails with the same error.
>
> 2) If I delete the xercesImpl included with jwsdp, running ant from within
> Eclipse still fails.
>
> 3) If I use ant1.6b2, it works great from the command line as long as I
> keep the xercesImpl that comes with it. Deleting that xercesImpl.jar also
> causes ant1.6b2 to fail.
>
> My current belief is that either new versions of ant or xjc don't like the
> xercesImpl that comes with Eclipse. Does this make sense? If so, it seems
> my only solution is to wait for M5, and then reconfigure Eclipse to use
> the xercesImpl that the newer ant likes?
>
> Am I right, or is there something else I should try? Thanks again for all
> the help,
> +scott
>
>
> Darin Swanson wrote:
>
> > Your classpath looks correct.
> > Are there any other JARs living in C:/jwsdp-1.3/apache-ant/?
> > Both ant.jar and optional.jar from Ant 1.5.4 have manifest files with
> > classpath entries that will cause Xerces JARs co-located with these JARs
to
> > be loaded by a URLClassLoader (even though they are not directed added
to
> > the Ant runtime classpath)...and this breaks within Eclipse. The
solution is
> > to ensure that no Xerces JARs are in the same physical location as the
> > ant.jar and optional.jar.
> > Note that Ant 1.6 has removed these pesky classpath entries in the
manifest
> > files.
>
> > HTH
> > Darins
>
> > "Scott Klemmer" <srk-nospam@cs.berkeley.edu> wrote in message
> > news:bpc2is$rjp$1@eclipse.org...
> > > Thanks for the help! I'm looking forward to M5...
> > >
> > > > What version of Ant is found at C:jwsdp-1.3apache-ant?
> > >
> > > I'm using Apache Ant version 1.5.4
> > >
> > > > Have you modified you Ant runtime classpath to include any Xerces
> > > > implementations? If so remove them and check out the Eclipse Readme,
> > Known
> > > > Issues: Ant section for the full details on this issue.
> > >
> > > My ant runtime classpath contains three entries:
> > > C:/jwsdp-1.3/apache-ant/ant.jar
> > > C:/jwsdp-1.3/apache-ant/optional.jar
> > > C:/j2sdk1.4.2/lib/tools.jar
> > >
> > > Is this correct?
> > >
> > > > You can point Eclipse to use any Ant install by setting the Ant home
> > > > location either globally on the Ant runtime classpath preference or
you
> > can
> > > > set it for each Ant launch configuration on the classpath tab. Again
you
> > > > will need to ensure no Xerces on the classpath.
> > >
> > > In Window-Preferences, I've set my ant home to be
C:jwsdp-1.3apache-ant.
> > > I took a screenshot of my ant settings and put it at
> > > http://www.cs.berkeley.edu/~srk/ant.gif
> > >
> > > Any thoughts on how to fix the validation error?
> > > +scott
> > >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04776 seconds