Junit Test From Ant--java.lang.LinkageError

T

Tom Koenning

I have a Junit test that runs fine from the command line, but when I
try to run it from Ant, it fails. I am using Junit 3.8.1, and the
exclude.properties file in Junit.jar is as follows:
#
# The list of excluded package paths for the TestCaseClassLoader
#
excluded.0=sun.*
excluded.1=com.sun.*
excluded.2=org.omg.*
excluded.3=javax.*
excluded.4=sunw.*
excluded.5=java.*
excluded.6=org.w3c.dom.*
excluded.7=org.xml.sax.*
excluded.8=net.jini.*

The path element I am using in ant is:
<path id="test.classpath" >
<pathelement location="${lib.dir}/httpunit.jar" />
<pathelement location="${lib.dir}/junit.jar" />
<pathelement location="${lib.dir}/Tidy.jar" />
<pathelement location="${lib.dir}/js.jar" />
<!-- <pathelement location="${lib.dir}/xalan.jar" /> -->
<pathelement location="${test.dir}" />
</path>

The error is:
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.651
sec

[junit] Testcase: testLogin(HttpUnitTest): Caused an ERROR
[junit] loader constraints violated when linking
org/xml/sax/InputSource class
[junit] java.lang.LinkageError: loader constraints violated when
linking org/xml/sax/InputSourc
class
[junit] at com.meterware.httpunit.parsing.NekoHTMLParser.parse(NekoHTMLParser.java:41)
[junit] at com.meterware.httpunit.HTMLPage.parse(HTMLPage.java:244)
[junit] at com.meterware.httpunit.WebResponse.getReceivedPage(WebResponse.java:975)
[junit] at com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:577)
[junit] at com.meterware.httpunit.javascript.JavaScript$Window.initialize(JavaScript.java:4
9)
[junit] at com.meterware.httpunit.javascript.JavaScript.run(JavaScript.java:80)
[junit] at com.meterware.httpunit.javascript.JavaScriptEngineFactory.associate(JavaScriptEn
ineFactory.java:46)
[junit] at com.meterware.httpunit.FrameHolder.<init>(FrameHolder.java:44)
[junit] at com.meterware.httpunit.WebWindow.<init>(WebWindow.java:218)
[junit] at com.meterware.httpunit.WebClient.<init>(WebClient.java:51)
[junit] at com.meterware.httpunit.WebConversation.<init>(WebConversation.java:46)
[junit] at HttpUnitTest.testLogin(Unknown Source)


[junit] TEST HttpUnitTest FAILED

Any suggestions are greatly appreciated.

Thanks, Tom K
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top