I'm following the walkthrough on the website and I keep getting a
RuntimeException from the HTMLParser. I also tried running test on
something like "http://www.google.com/index.html", but everything has
resulted in this:
java.lang.RuntimeException: Failed parsing content from
http://localhost:7001/myapp/test.html
at
com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:234)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:112)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:85)
at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:441)
at
com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:345)
at
com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:399)
at
net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog.beginAt(HtmlUnitDialog.java:161)
at
net.sourceforge.jwebunit.junit.WebTester.beginAt(WebTester.java:190)
at
net.sourceforge.jwebunit.junit.WebTestCase.beginAt(WebTestCase.java:130)
at
com.jpmorgan.gcrm.clive.profile.PQEWebTestCase.testOpenPage(PQEWebTestCase.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at
net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:58)
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:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: com.gargoylesoftware.htmlunit.ScriptException: Bad method
parameters for "init".
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.initialize(JavaScriptEngine.java:148)
at
com.gargoylesoftware.htmlunit.WebClient.initialize(WebClient.java:1024)
at
com.gargoylesoftware.htmlunit.WebWindowImpl.setEnclosedPage(WebWindowImpl.java:106)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.startDocument(HTMLParser.java:367)
at
org.apache.xerces.parsers.AbstractSAXParser.startDocument(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.cyberneko.html.filters.DefaultFilter.startDocument(DefaultFilter.java:102)
at
org.cyberneko.html.filters.NamespaceBinder.startDocument(NamespaceBinder.java:247)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.cyberneko.html.HTMLTagBalancer.startDocument(HTMLTagBalancer.java:380)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1915)
at
org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:809)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLParser.java:346)
at
com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:229)
... 28 more
Caused by: org.mozilla.javascript.EvaluatorException: Bad method
parameters for "init".
at
org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:61)
at
org.mozilla.javascript.Context.reportRuntimeError(Context.java:549)
at
org.mozilla.javascript.Context.reportRuntimeError(Context.java:587)
at
org.mozilla.javascript.Context.reportRuntimeError1(Context.java:563)
at
org.mozilla.javascript.FunctionObject.<init>(FunctionObject.java:177)
at
org.mozilla.javascript.ScriptableObject.defineClass(ScriptableObject.java:992)
at
org.mozilla.javascript.ScriptableObject.defineClass(ScriptableObject.java:706)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.configureClass(JavaScriptEngine.java:168)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.initialize(JavaScriptEngine.java:138)
... 54 more
Contents of test
===========================
import net.sourceforge.jwebunit.junit.WebTestCase;
import net.sourceforge.jwebunit.util.TestingEngineRegistry;
public class PQEWebTestCase extends WebTestCase {
public PQEWebTestCase(String name) {
super(name);
}
public void setUp() throws Exception {
setTestingEngineKey(TestingEngineRegistry.TESTING_ENGINE_HTMLUNIT);
getTestContext().setBaseUrl("http://localhost:7001/myapp/");
setScriptingEnabled(false);
}
public void testOpenPage(){
beginAt("/test.html");
}
}
-----------------------------------------
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.
This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.
Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users