Have you tried setting maven.junit.fork=true?

I usually have to do that with unit tests where XML is involved.

Cheers,
Brett

> -----Original Message-----
> From: John Farrell [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, 14 August 2003 10:18 AM
> To: Maven Users List
> Subject: java.lang.LinkageError: loader constraints violated 
> when linking
> 
> 
> I've got an exception coming out in my test:test target which 
> I just can't 
> figure out. It's a LinkageError loading org.w3c.dom.Document. My 
> understanding of this error is that the classloader needs to 
> load the same 
> class from two different jars, but I can't figure out which 
> jars. The obvious 
> suspect is xml-apis.jar, of which we have only version 
> 1.0.b2. Other suspects 
> for which there is less justification are xalan 2.5.1 and 
> xerces 2.4.0.
> 
> To try to figure this out, in my code I asked for the 
> classloader and found it 
> was an AntClassloader. You can ask the AntClassloader what 
> classpath it is 
> using, so I did that. Then, from a command line, I could use 
> that classpath 
> to run the unit tests and they worked just fine. So I believe 
> that somewhere 
> in ant or maven, the classloaders are getting tangled up and 
> causing this 
> error.
> 
> Unfortunately that extremely vague explanation doesn't help 
> me get my tests to 
> run. If anyone has any ideas on what could be wrong, or what 
> I could try to 
> get further information, please let me know. I am kind of at 
> my half-wit's 
> end here :-(. Thanks,
> 
> John
> ----
> [junit] java.lang.LinkageError: loader constraints violated 
> when linking 
> org/w3c/dom/Document class
>     [junit]     at 
> com.mincom.util.xml.xfs.XfsFile.parseString(XfsFile.java:87)
>     [junit]     at 
> com.mincom.util.xml.xfs.XfsFile.parse(XfsFile.java:76)
>     [junit]     at 
> com.mincom.util.xml.xfs.XFSUnitTest.testDTDUpdate(XFSUnitTest.java:59)
>     [junit]     at 
> org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:232)
>     [junit]     at 
> org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
>     [junit]     at 
> org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
>     [junit]     at 
> org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
>     [junit]     at 
> org.apache.commons.jelly.tags.core.IfTag.doTag(IfTag.java:88)
>     [junit]     at 
> org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
>     [junit]     at 
> org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
>     [junit]     at 
> org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
>     [junit]     at 
> com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
>     [junit]     at com.werken.werkz.Goal.fire(Goal.java:639)
>     [junit]     at com.werken.werkz.Goal.attain(Goal.java:575)
>     [junit]     at 
> com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
>     [junit]     at 
> com.werken.werkz.jelly.AttainGoalTag.doTag(AttainGoalTag.java:134)
>     [junit]     at 
> org.apache.maven.jelly.tags.werkz.LazyAttainGoalTag.doTag(Lazy
> AttainGoalTag.java:107)
>     [junit]     at 
> org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
>     [junit]     at 
> org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
>     [junit]     at 
> org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
>     [junit]     at 
> com.werken.werkz.jelly.GoalTag$1.performAction(GoalTag.java:128)
>     [junit]     at com.werken.werkz.Goal.fire(Goal.java:639)
>     [junit]     at com.werken.werkz.Goal.attain(Goal.java:575)
>     [junit]     at 
> com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
>     [junit]     at 
> com.werken.werkz.jelly.AttainGoalTag.doTag(AttainGoalTag.java:134)
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Reply via email to