I'm sorry I haven't been able to isolate this - only happens periodically when running my tests.
Hopefully not too hard to fix.
java.lang.NullPointerException: null (NativeException)
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:329:in `isVisible'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:319:in `appendText'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:116:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:220:in `appendChildren'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:174:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:220:in `appendChildren'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:174:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:220:in `appendChildren'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:174:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:220:in `appendChildren'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:174:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:220:in `appendChildren'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:174:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:220:in `appendChildren'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:174:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:220:in `appendChildren'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:174:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:220:in `appendChildren'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:174:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:220:in `appendChildren'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:174:in `appendNode'
com/gargoylesoftware/htmlunit/html/HtmlSerializer.java:47:in `asText'
com/gargoylesoftware/htmlunit/html/DomNode.java:671:in `asText'
Who's calling DomNode.asText() at the bottom of the stack trace? Is it user code? I'm just trying to figure out if maybe it's being executed from the main thread while background JS is modifying the DOM.
Yes, that is a very likely explanation - the user code is polling the DOM for a JS update - so asText() is being called from the main thread.
Here's the full backtrace JRuby backtrace:
I'm hesitant to guess at a fix here, but I'm having trouble writing a test case that exhibits this behavior. Can you come up with something (in Java)? If not, we'll wait until after the 2.6 release and then do a bit of guessing at a solution.
Having a hard time isolating the issue - the page in question does an AJAX poll, and fails pretty rarely.
The best I can do is offer to run our test suite with a build of HtmlUnit that prints some debug info that would confirm your guesses. Let me know!
Hi Jari,
is this still an issue for you. If yes, please test again with the latest version.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 30 days (the time period specified by
the administrator of this Tracker).