Junit Test From Ant--java.lang.LinkageError

Discussion in 'Java' started by Tom Koenning, Jul 28, 2003.

  1. Tom Koenning

    Tom Koenning Guest

    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
    Tom Koenning, Jul 28, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phlip
    Replies:
    0
    Views:
    823
    Phlip
    Sep 22, 2005
  2. Replies:
    0
    Views:
    4,564
  3. sk
    Replies:
    0
    Views:
    2,267
  4. sk
    Replies:
    0
    Views:
    520
  5. Replies:
    1
    Views:
    5,104
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Nov 12, 2007
Loading...

Share This Page