net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: Exception: java.lang.NullPointerException in HtmlUnit 2.43
See original GitHub issueGetting the below exception while calling getPage for url: https://investors.alticeusa.com/investors/alticeusa/results-and-presentations/default.aspx using HtmlUnit 2.43.0 version but version 2.23 is not throwing the exceptions.
Exception in thread "main" net.sourceforge.htmlunit.corejs.javascript.EvaluatorException: Exception: java.lang.NullPointerException at net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError(Context.java:1040) at net.sourceforge.htmlunit.corejs.javascript.Context.reportRuntimeError(Context.java:1090) at com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.loadStylesheet(CSSStyleSheet.java:410) at com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLinkElement.getSheet(HTMLLinkElement.java:143) at com.gargoylesoftware.htmlunit.html.HtmlLink$1.execute(HtmlLink.java:311) at com.gargoylesoftware.htmlunit.html.HtmlLink.onAllChildrenAddedToPage(HtmlLink.java:321) at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:560) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.endElement(HtmlUnitNekoDOMBuilder.java:514) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.startElement(HTMLTagBalancer.java:773) at net.sourceforge.htmlunit.cyberneko.HTMLTagBalancer.emptyElement(HTMLTagBalancer.java:820) at net.sourceforge.htmlunit.cyberneko.filters.DefaultFilter.emptyElement(DefaultFilter.java:145) at net.sourceforge.htmlunit.cyberneko.filters.NamespaceBinder.emptyElement(NamespaceBinder.java:310) at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scanStartElement(HTMLScanner.java:2769) at net.sourceforge.htmlunit.cyberneko.HTMLScanner$ContentScanner.scan(HTMLScanner.java:2117) at net.sourceforge.htmlunit.cyberneko.HTMLScanner.scanDocument(HTMLScanner.java:927) at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:506) at net.sourceforge.htmlunit.cyberneko.HTMLConfiguration.parse(HTMLConfiguration.java:459) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoDOMBuilder.parse(HtmlUnitNekoDOMBuilder.java:760) at com.gargoylesoftware.htmlunit.html.parser.neko.HtmlUnitNekoHtmlParser.parse(HtmlUnitNekoHtmlParser.java:208) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:283) at com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:163) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:638) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:451) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:368) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:520) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:501) at com.factset.htmlunit.testapp.main(testapp.java:99)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
for me it looks like the problem is in your code
If you code sets the response to null, the next line after the if block will produce the NPE.
Working now. Thanks for your help.