NullPointerException in handleJavaScriptException
See original GitHub issueI get the following NPE with HtmlUnit. I’m hoping the fix will be obvious to someone that knows the code well. If not I can try to come up with a way to reproduce it.
Thanks!
2020-02-17 15:29:15,504 ERROR [com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl] Job run failed with unexpected RuntimeException: null
java.lang.NullPointerException: null
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.handleJavaScriptException(JavaScriptEngine.java:984) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:886) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:624) ~[htmlunit-core-js-2.37.0.jar:?]
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:537) ~[htmlunit-core-js-2.37.0.jar:?]
at com.gargoylesoftware.htmlunit.javascript.HtmlUnitContextFactory.callSecured(HtmlUnitContextFactory.java:354) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:815) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest.setState(XMLHttpRequest.java:211) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest.doSend(XMLHttpRequest.java:785) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest.access$000(XMLHttpRequest.java:103) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest$1.run(XMLHttpRequest.java:634) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:624) ~[htmlunit-core-js-2.37.0.jar:?]
at net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:537) ~[htmlunit-core-js-2.37.0.jar:?]
at com.gargoylesoftware.htmlunit.javascript.background.JavascriptXMLHttpRequestJob.run(JavascriptXMLHttpRequestJob.java:36) ~[htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.runSingleJob(JavaScriptJobManagerImpl.java:424) [htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at com.gargoylesoftware.htmlunit.javascript.background.DefaultJavaScriptExecutor.run(DefaultJavaScriptExecutor.java:148) [htmlunit-2.38.0-SNAPSHOT.jar:2.38.0-SNAPSHOT]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
[Htmlunit-user] null pointer exception (in java-script)
Hello, I am using htmlunit for (small) data harvesting application. After pro-grammatically clicking one of the links, which opens
Read more >HTMLUnit hangs/infinite loop on javascript exception
This is about HTMLUnit v2.24. On hitting this URL, The following exception is observed after which HTMLUnit does not proceed.
Read more >'Re: [Htmlunit-user] How to restore javascript variables?' - MARC
NullPointerException.Some of the variables are functions and complex browser objects so I think we can't set them by using "variable_name=" + value.
Read more >HtmlUnit / Bugs / #1589 java.lang.NullPointerException in ...
I am copying the junit test that recreates the problem. The stack trace: Exception in thread "main" net.sourceforge.htmlunit.corejs.javascript.
Read more >com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine
catch (final Exception e) { handleJavaScriptException(new ScriptException(htmlPage_, e, getSourceCode(cx)));
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for the delay, but… Think i have found the reason (and a solution) for your problem. Will make a new snapshot build later today (please check https://twitter.com/HtmlUnit for details).
Please try and inform about your results.
i guess this is fixed