Menu

NoSuchMethod: Xerces: Augmentations.clear()V

2004-03-17
2004-09-17
  • Mats Henricson

    Mats Henricson - 2004-03-17

    I've started to get these wird errors with HttpUnit the last few weeks. It bombs in the constructor to WebConversation! What I've done lately is migrating all my pages and code to UTF-8. It works just fine, but my HttpUnit tests are now failing... :-)

    Anyone with a clue?

        [junit] Testcase: testBasicUpl(info.codeq.upl.test.WebTest):        Caused an ERROR
        [junit] org.apache.xerces.xni.Augmentations.clear()V
        [junit] java.lang.NoSuchMethodError: org.apache.xerces.xni.Augmentations.clear()V
        [junit]     at org.cyberneko.html.HTMLScanner.locationAugs(Unknown Source)
        [junit]     at org.cyberneko.html.HTMLScanner$ContentScanner.scan(Unknown Source)
        [junit]     at org.cyberneko.html.HTMLScanner.scanDocument(Unknown Source)
        [junit]     at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source)
        [junit]     at org.cyberneko.html.HTMLConfiguration.parse(Unknown Source)
        [junit]     at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        [junit]     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        [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:1014)
        [junit]     at com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:611)
        [junit]     at com.meterware.httpunit.javascript.JavaScript$Window.initialize(JavaScript.java:424)
        [junit]     at com.meterware.httpunit.javascript.JavaScript.run(JavaScript.java:80)
        [junit]     at com.meterware.httpunit.javascript.JavaScriptEngineFactory.associate(JavaScriptEngineFactory.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:50)
        [junit]     at com.meterware.httpunit.WebConversation.<init>(WebConversation.java:46)
        [junit]     at info.codeq.upl.test.WebTest.testBasicUpl(WebTest.java:17)

     
    • Anonymous

      Anonymous - 2004-03-22

      I am new to Httpunit and trying to implement my first test case using it. I am getting the same error and I'm at a loss.

       
    • David Demmer

      David Demmer - 2004-04-05

      I've seen this when my tests were deployed with a different version of xerces than what httpunit 1.5.4 was packaged with.

       
    • Anonymous

      Anonymous - 2004-04-29

      I recently started a new project and used the xerces parser that comes with the latest version of HttpUnit and for some reason I get the same error as above...

      "org.apache.xerces.xni.Augmentations.clear()V"

      I get this error when calling WebResponse>>getTitle() (obviously trying to use the parser services).

      My work around was to ditch xerces and just use the Tidy.jar parser. However I would like an answer why xerces does not work ?

       
    • Rama

      Rama - 2004-09-17

      Get the source for nekohtml.jar ver 0.7.2 and update src/html/org/cyberneko/htmlHTMLScanner.java class's locationAugs()  method. Instead of augs.clear(); line
      add try {
                      augs.clear();
                  }
                  catch (NoSuchMethodError e) {
                      augs.removeItem(AUGMENTATIONS);
                  }
      and rebuild nekohtml.jar with the changes  in jdk 1.3 and use this jar in httpunit. Tests works fine

       

Log in to post a comment.

Monday.com Logo