Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 394
  • Last Modified:

Classpath? Problem with HttpUnit/NekoHTML

I'm having a wierd classpath issue with nekohtml/httpunit


I'm using httpunit 1.5.1.. My tests run fine when I use Tidy, but I need to use the Neko parser b/c of an issue I'm having with params in a form (I've tried the httpunit prereleases it doesn't seem to keep my session....) anyways, when I switch to neko I get  a java.lang.NoSuchMethodError
     at com.meterware.httpunit.DOMParser.<init>(NekoHTMLParser.java:125)
 exception.

I have the following in my classpath:
  cactus-1.4b1.jar
   nekohtml.jar
   nekohtml-0.7.3/nekohtmlXni.jar
    xmlParserAPIs.jar
    junit.jar
    rt.jar
    aspectjrt-1.0.5.jar
    commons-httpclient-2.0alpha1-20020720.jar
    commons-logging-1.0.jar
    strutstest-1.9.6.jar
    sax.jar
    xercesMinimal.jar
    nekohtmlSamples.jar
    xercesImpl.jar
    xercesImpl.jar

I've tried various combinations and orderings of the jars with no luck...

Thanks
Mike




java.lang.NoSuchMethodError
     at com.meterware.httpunit.DOMParser.<init>(NekoHTMLParser.java:125)
     at com.meterware.httpunit.DOMParser.newParser(NekoHTMLParser.java:85)
     at com.meterware.httpunit.NekoHTMLParser.parse(NekoHTMLParser.java:48)
     at com.meterware.httpunit.HTMLPage.parse(HTMLPage.java:263)
     at com.meterware.httpunit.WebResponse.getReceivedPage(WebResponse.java:973)
     at com.meterware.httpunit.WebResponse.access$100(WebResponse.java:51)
     at com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:582)
     at com.meterware.httpunit.javascript.JavaScript$Window.initialize(JavaScript.java:396)
     at com.meterware.httpunit.javascript.JavaScript.run(JavaScript.java:80)
     at com.meterware.httpunit.javascript.JavaScriptEngineFactory.associate(JavaScriptEngineFactory.java:46)
     at com.meterware.httpunit.FrameHolder.<init>(FrameHolder.java:47)
     at com.meterware.httpunit.WebWindow.<init>(WebWindow.java:205)
     at com.meterware.httpunit.WebClient.<init>(WebClient.java:51)
     at com.meterware.httpunit.WebConversation.<init>(WebConversation.java:46)
     at TestSampleServlet.beginSaveToSessionOK(TestSampleServlet.java:46)
     at java.lang.reflect.Method.invoke(Native Method)
     at org.apache.cactus.AbstractTestCase.callBeginMethod(AbstractTestCase.java:290)
     at org.apache.cactus.AbstractWebTestCase.runGenericTest(AbstractWebTestCase.java:236)
     at org.apache.cactus.ServletTestCase.runTest(ServletTestCase.java:133)
     at org.apache.cactus.AbstractTestCase.runBare(AbstractTestCase.java:195)
     at junit.framework.TestResult$1.protect(TestResult.java:106)
     at junit.framework.TestResult.runProtected(TestResult.java:124)
     at junit.framework.TestResult.run(TestResult.java:109)
     at junit.framework.TestCase.run(TestCase.java:118)
     at junit.framework.TestSuite.runTest(TestSuite.java:208)
     at junit.framework.TestSuite.run(TestSuite.java:203)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:329)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:218)
     at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:151)

Thanks
Mike
0
sfotex
Asked:
sfotex
  • 3
  • 3
1 Solution
 
CEHJCommented:
Is that *exactly* what it's saying at the top of the stack trace?

java.lang.NoSuchMethodError
    at com.meterware.httpunit.DOMParser.<init>(NekoHTMLParser.java:125)
0
 
sfotexAuthor Commented:
Yeup,
Cut and pasted..
Here's a url with some info on configuring the parser...
http://www.apache.org/~andyc/neko/doc/html/settings.html

I've tried setting the domparser in the config...but no go..
0
 
CEHJCommented:
Looks like a bug in the meterware libraries to me - have you got the latest version?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
sfotexAuthor Commented:
Everythings current..

It's bombing on the call to the super config:

 DOMParser( HTMLConfiguration configuration, HTMLPage page ) {
        super( configuration );
        _htmlPage = page;


HTMLConfiguration  extends  xerces.util.ParserConfigSettings

but the DomParser impli. super takes  
  xerces.xni.parser.ParserConfigSettings...
0
 
sfotexAuthor Commented:
Figured it out --
Seems that the srutstest.jar conflicts with nekohtml.jar

I moved strutstestcase below neko.jar and it works....

 
0
 
CEHJCommented:
OK - better get CS to refund you.
0
 
SpideyModCommented:
PAQ'd and points refunded.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now