tenderlove/nokogiri — Issue #548: Null pointer when xml parsing in jruby 1.6.4 and nokogiri (1.5.0 java)
Author: tc
Created: 2011-10-11 22:41:13+00:00
State: open

I get a null pointer error when parsing the string below:

Works in ruby 1.9.2

```
xml_string = "\\n

WXYG(540AM broadcastingAM) is an Americanradio stationintended to serveSauk Rapids, Minnesota, USA. The station is part of theTri-County Broadcastinggroup and theconstruction permitis held by Herbert M. Hoppe. WXYG recently signed on the air with aclassic rockformat.HistoryThis station received its originalconstruction permitfrom theFederal Communications Commissionon July 26,2007 in radio2007.The new station was assigned thecall signWXYG by the FCC on September 10, 2007.The call sign was changed to WMIN on August 12, 2008, to WPPI on December 2, 2008, and back to WXYG on December 14, 2009.This construction permit was scheduled to expire on July 25, 2010.As of November 8, 2010, WXYG, which has been occasionally testing with a mix of rock andcountry musicsince June, began playingChristmas music. The station resumed testing after the holiday season. On May 23, 2011, the FCC granted the stationprogram text authorityto begin broadcasting before receiving its broadcast license.On June 24, 2011 WXYG ended testing and signed on the air with album rock, branded as \"Album Classic rockRock 540, The Goat\".ReferencesExternal links

Tri-County Broadcasting

Category:Benton County, MinnesotaCategory:Proposed radio stations

"

doc = Nokogiri::XML(xml_string)
doc.text
Java::JavaLang::NullPointerException:
from nokogiri.XmlNode.content(XmlNode.java:730)
from nokogiri.XmlNode$i$0$0$content.call(XmlNode$i$0$0$content.gen:65535)
from org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:56)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:292)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
from org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:63)
from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
from org.jruby.ast.RootNode.interpret(RootNode.java:129)
from org.jruby.evaluator.ASTInterpreter.INTERPRET_EVAL(ASTInterpreter.java:96)
from org.jruby.evaluator.ASTInterpreter.evalWithBinding(ASTInterpreter.java:161)
from org.jruby.RubyKernel.evalCommon(RubyKernel.java:1135)
from org.jruby.RubyKernel.eval(RubyKernel.java:1088)
from org.jruby.RubyKernel$s$0$3$eval.call(RubyKernel$s$0$3$eval.gen:65535)
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:181)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:69)
from org.jruby.ast.FCallManyArgsNode.interpret(FCallManyArgsNode.java:60)
... 114 levels...
from org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:190)
from org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:179)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:312)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:169)
from Users.t.$_dot_rvm.rubies.jruby_minus_1_dot_6_dot_4.bin.irb.__file__(/Users/t/.rvm/rubies/jruby-1.6.4/bin/irb:17)
from Users.t.$_dot_rvm.rubies.jruby_minus_1_dot_6_dot_4.bin.irb.load(/Users/t/.rvm/rubies/jruby-1.6.4/bin/irb)
from org.jruby.Ruby.runScript(Ruby.java:679)
from org.jruby.Ruby.runScript(Ruby.java:672)
from org.jruby.Ruby.runNormally(Ruby.java:579)
from org.jruby.Ruby.runFromMain(Ruby.java:428)
from org.jruby.Main.doRunFromMain(Main.java:278)
from org.jruby.Main.internalRun(Main.java:198)
from org.jruby.Main.run(Main.java:164)
from org.jruby.Main.run(Main.java:148)
```