You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wendy Smoak <ws...@apache.org> on 2005/10/25 07:57:47 UTC
[m2] Switching XML Parsers?
I'm having trouble with some tests failing in Maven 2 when they work fine in
Ant and Maven 1.0.2.
The problem (SaxParseException and NPE) happens way down in the XML Parser.
(The test uses Commons Chain which uses Digester which uses...)
>From http://maven.apache.org/faq.html#unit-test-14 I get that 1.0.2 included
an XML parser (Xerces 2.4.0) but 1.1 doesn't, which I assume is the case
with 2.0. I'm seeing org.apache.crimson in the stack trace.
How can I get Maven 2 to use Xerces, so I can tell whether that's the
problem? I'm not sure if I'm supposed to set something in Surefire, or
whether this is a JVM level thing.
Thanks,
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Switching XML Parsers?
Posted by Wendy Smoak <ws...@apache.org>.
Kenney wrote:
> This is a jvm thing. You probably have a JDK that has a buggy version of
> xerces (or xalan, if you're using stylesheets).
>
> Adding a dependency on xerces (or another xml parser) should fix this.
I'm using 1.4.2_09 and I'm pretty sure it was using Crimson, at least that's
what I was seeing in the stack trace.
I added the following dependencies, but it didn't help, I still get the NPE
and SaxParseException and the tests fail under m2. (Is this what you were
suggesting?)
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>2.0.2</version>
<scope>test</scope>
</dependency>
Then I tried switching to Xerces 2.7.1, but couldn't find an xml-apis jar
containing org.xml.sax.ext.Attributes2 in the repository. After putting the
one
that came with the Xerces download in my local repository, it went back to
the NPE/SaxParseException.
I copied the artifacts that I'm building (shale-core and shale-test) from my
m1 repository (the tests work fine under m1) to my m2 repository, just to
make sure I wasn't missing something, but still no luck.
I do get a slightly better error message with Xerces 2.4.0, in that it has a
column number instead of -1: "Error at (41, 47: null"
It's complaining about line 41, column 47, which is the end of the 2nd line:
<action name="first"
method="#{test.first}">
(The entire file is here:
http://svn.apache.org/repos/asf/struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/faces/dialog-config.xml )
What else can I try?
Thanks,
--
Wendy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Switching XML Parsers?
Posted by Kenney Westerhof <ke...@apache.org>.
On Mon, 24 Oct 2005, Wendy Smoak wrote:
This is a jvm thing. You probably have a JDK that has a buggy version of
xerces (or xalan, if you're using stylesheets).
Adding a dependency on xerces (or another xml parser) should fix this.
I personally only had trouble with the Xalan shipped with jdk 1.5.
-- Kenney
> I'm having trouble with some tests failing in Maven 2 when they work fine in
> Ant and Maven 1.0.2.
>
> The problem (SaxParseException and NPE) happens way down in the XML Parser.
> (The test uses Commons Chain which uses Digester which uses...)
>
> >From http://maven.apache.org/faq.html#unit-test-14 I get that 1.0.2 included
> an XML parser (Xerces 2.4.0) but 1.1 doesn't, which I assume is the case
> with 2.0. I'm seeing org.apache.crimson in the stack trace.
>
> How can I get Maven 2 to use Xerces, so I can tell whether that's the
> problem? I'm not sure if I'm supposed to set something in Surefire, or
> whether this is a JVM level thing.
>
> Thanks,
> Wendy Smoak
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org