Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null pointer exception with XML builder #1039

Closed
pareeohnos opened this issue Jan 31, 2014 · 9 comments
Closed

Null pointer exception with XML builder #1039

pareeohnos opened this issue Jan 31, 2014 · 9 comments

Comments

@pareeohnos
Copy link

I'm trying to create an app that connects with an exchange server using EWS, and using the library ViewPoint for handling this.

Previously I was writing the app in MRI ruby, but we've now switched over to jRuby, and I've now noticed that it has completely broken the exchange interface code. I know the code works, and the ViewPoint library hasn't been updated at any point, but I'm not sure whether the bug lies in their code, or nokogiri, but essentially when I attempt to request data from the server, I receive the following stack trace (sorry about the size)

    java.lang.NullPointerException
    at nokogiri.internals.NokogiriNamespaceCache.hashCode(NokogiriNamespaceCache.java:67)
    at nokogiri.internals.NokogiriNamespaceCache.put(NokogiriNamespaceCache.java:114)
    at nokogiri.XmlNamespace.createFromPrefixAndHref(XmlNamespace.java:156)
    at nokogiri.XmlNode.add_namespace_definition(XmlNode.java:592)
    at nokogiri.XmlNode$INVOKER$i$2$0$add_namespace_definition.call(XmlNode$INVOKER$i$2$0$add_namespace_definition.gen)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:202)
    at org.jruby.ast.FCallTwoArgNode.interpret(FCallTwoArgNode.java:38)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:198)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
    at org.jruby.ast.AttrAssignOneArgNode.interpret(AttrAssignOneArgNode.java:39)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
    at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:125)
    at org.jruby.runtime.Block.call(Block.java:101)
    at org.jruby.RubyProc.call(RubyProc.java:290)
    at org.jruby.RubyProc.call19(RubyProc.java:271)
    at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(RubyProc$INVOKER$i$0$0$call19.gen)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:206)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    at rubyjit.Nokogiri::XML::Builder$$insert_DECDE5971FAA4E7858D034F538068C4EFAB8693F1002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb:391)
    at rubyjit.Nokogiri::XML::Builder$$insert_DECDE5971FAA4E7858D034F538068C4EFAB8693F1002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:201)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
    at rubyjit.Nokogiri::XML::Builder$$method_missing_51BB9064EFCCB584335D85E24C201D6D960954721002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb:375)
    at rubyjit.Nokogiri::XML::Builder$$method_missing_51BB9064EFCCB584335D85E24C201D6D960954721002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:101)
    at org.jruby.runtime.Helpers$MethodMissingMethod.call(Helpers.java:447)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:202)
    at org.jruby.runtime.callsite.CachingCallSite.callMethodMissing(CachingCallSite.java:397)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:145)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
    at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:198)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
    at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:125)
    at org.jruby.runtime.Block.call(Block.java:101)
    at org.jruby.RubyProc.call(RubyProc.java:290)
    at org.jruby.RubyProc.call19(RubyProc.java:271)
    at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(RubyProc$INVOKER$i$0$0$call19.gen)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:206)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    at rubyjit.Nokogiri::XML::Builder$$insert_DECDE5971FAA4E7858D034F538068C4EFAB8693F1002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb:391)
    at rubyjit.Nokogiri::XML::Builder$$insert_DECDE5971FAA4E7858D034F538068C4EFAB8693F1002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:201)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
    at rubyjit.Nokogiri::XML::Builder$$method_missing_51BB9064EFCCB584335D85E24C201D6D960954721002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb:375)
    at rubyjit.Nokogiri::XML::Builder$$method_missing_51BB9064EFCCB584335D85E24C201D6D960954721002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:101)
    at org.jruby.runtime.Helpers$MethodMissingMethod.call(Helpers.java:447)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.runtime.callsite.CachingCallSite.callMethodMissing(CachingCallSite.java:409)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:333)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:179)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
    at org.jruby.ast.CallOneArgBlockNode.interpret(CallOneArgBlockNode.java:60)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.IfNode.interpret(IfNode.java:118)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:177)
    at org.jruby.runtime.Interpreted19Block.yieldSpecific(Interpreted19Block.java:140)
    at org.jruby.runtime.Block.yieldSpecific(Block.java:129)
    at org.jruby.ast.YieldTwoNode.interpret(YieldTwoNode.java:31)
    at org.jruby.ast.IfNode.interpret(IfNode.java:116)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
    at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:125)
    at org.jruby.runtime.Block.call(Block.java:101)
    at org.jruby.RubyProc.call(RubyProc.java:290)
    at org.jruby.RubyProc.call19(RubyProc.java:271)
    at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(RubyProc$INVOKER$i$0$0$call19.gen)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:206)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    at rubyjit.Nokogiri::XML::Builder$$insert_DECDE5971FAA4E7858D034F538068C4EFAB8693F1002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb:391)
    at rubyjit.Nokogiri::XML::Builder$$insert_DECDE5971FAA4E7858D034F538068C4EFAB8693F1002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:201)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
    at rubyjit.Nokogiri::XML::Builder$$method_missing_51BB9064EFCCB584335D85E24C201D6D960954721002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb:375)
    at rubyjit.Nokogiri::XML::Builder$$method_missing_51BB9064EFCCB584335D85E24C201D6D960954721002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:101)
    at org.jruby.runtime.Helpers$MethodMissingMethod.call(Helpers.java:447)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:202)
    at org.jruby.runtime.callsite.CachingCallSite.callMethodMissing(CachingCallSite.java:397)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:145)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
    at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
    at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:125)
    at org.jruby.runtime.Block.call(Block.java:101)
    at org.jruby.RubyProc.call(RubyProc.java:290)
    at org.jruby.RubyProc.call19(RubyProc.java:271)
    at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(RubyProc$INVOKER$i$0$0$call19.gen)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:206)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    at rubyjit.Nokogiri::XML::Builder$$insert_DECDE5971FAA4E7858D034F538068C4EFAB8693F1002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb:391)
    at rubyjit.Nokogiri::XML::Builder$$insert_DECDE5971FAA4E7858D034F538068C4EFAB8693F1002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:201)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
    at rubyjit.Nokogiri::XML::Builder$$method_missing_51BB9064EFCCB584335D85E24C201D6D960954721002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb:375)
    at rubyjit.Nokogiri::XML::Builder$$method_missing_51BB9064EFCCB584335D85E24C201D6D960954721002144240.__file__(/Users/adrianh/.rvm/gems/jruby-1.7.10/gems/nokogiri-1.6.1-java/lib/nokogiri/xml/builder.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:101)
    at org.jruby.runtime.Helpers$MethodMissingMethod.call(Helpers.java:447)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210)
    at org.jruby.runtime.callsite.CachingCallSite.callMethodMissing(CachingCallSite.java:409)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:333)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:179)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
    at org.jruby.ast.CallOneArgBlockNode.interpret(CallOneArgBlockNode.java:60)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:204)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:206)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
    at org.jruby.ast.CallOneArgBlockPassNode.interpret(CallOneArgBlockPassNode.java:60)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:161)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:190)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:143)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
    at org.jruby.ast.FCallNoArgBlockNode.interpret(FCallNoArgBlockNode.java:32)
    at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:198)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:204)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:206)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
    at org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
    at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:198)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
    at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.RootNode.interpret(RootNode.java:129)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_EVAL(ASTInterpreter.java:95)
    at org.jruby.evaluator.ASTInterpreter.evalWithBinding(ASTInterpreter.java:184)
    at org.jruby.RubyKernel.evalCommon(RubyKernel.java:1156)
    at org.jruby.RubyKernel.eval19(RubyKernel.java:1119)
    at org.jruby.RubyKernel$INVOKER$s$0$3$eval19.call(RubyKernel$INVOKER$s$0$3$eval19.gen)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:180)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:70)
    at rubyjit.IRB::WorkSpace$$evaluate_73F7B7512EA0512CE26D76ABBFF11BBFE5DAA7911002144240.__file__(/Users/adrianh/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/irb/workspace.rb:80)
    at rubyjit.IRB::WorkSpace$$evaluate_73F7B7512EA0512CE26D76ABBFF11BBFE5DAA7911002144240.__file__(/Users/adrianh/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/irb/workspace.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:121)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:70)
    at org.jruby.ast.CallManyArgsNode.interpret(CallManyArgsNode.java:59)
    at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:225)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:214)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:202)
    at org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
    at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
    at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:157)
    at org.jruby.runtime.Interpreted19Block.yieldSpecific(Interpreted19Block.java:130)
    at org.jruby.runtime.Block.yieldSpecific(Block.java:111)
    at rubyjit.IRB::Irb$$signal_status_C98378E2B3B952E4E56C57D822CCAD331005AB321002144240.chained_0_ensure_1$RUBY$__ensure__(/Users/adrianh/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/irb.rb:273)
    at rubyjit.IRB::Irb$$signal_status_C98378E2B3B952E4E56C57D822CCAD331005AB321002144240.__file__(/Users/adrianh/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/irb.rb:272)
    at rubyjit.IRB::Irb$$signal_status_C98378E2B3B952E4E56C57D822CCAD331005AB321002144240.__file__(/Users/adrianh/.rvm/rubies/jruby-1.7.10/lib/ruby/1.9/irb.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:201)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
    at org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:177)
    at org.jruby.runtime.Interpreted19Block.yieldSpecific(Interpreted19Block.java:140)
    at org.jruby.runtime.Block.yieldSpecific(Block.java:129)
    at org.jruby.ast.YieldTwoNode.interpret(YieldTwoNode.java:31)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.IfNode.interpret(IfNode.java:116)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
    at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
    at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:157)
    at org.jruby.runtime.Interpreted19Block.yieldSpecific(Interpreted19Block.java:130)
    at org.jruby.runtime.Block.yieldSpecific(Block.java:111)
    at org.jruby.RubyKernel.loop(RubyKernel.java:1519)
    at org.jruby.RubyKernel$INVOKER$s$0$0$loop.call(RubyKernel$INVOKER$s$0$0$loop.gen)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:316)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:145)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
    at org.jruby.ast.FCallNoArgBlockNode.interpret(FCallNoArgBlockNode.java:32)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:157)
    at org.jruby.runtime.Block.yield(Block.java:142)
    at org.jruby.RubyContinuation.enter(RubyContinuation.java:107)
    at org.jruby.RubyKernel.rbCatch19Common(RubyKernel.java:1289)
    at org.jruby.RubyKernel.rbCatch19(RubyKernel.java:1282)
    at org.jruby.RubyKernel$INVOKER$s$rbCatch19.call(RubyKernel$INVOKER$s$rbCatch19.gen)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:336)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:179)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
    at org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:161)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:190)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:316)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:145)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
    at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:157)
    at org.jruby.runtime.Block.yield(Block.java:142)
    at org.jruby.RubyContinuation.enter(RubyContinuation.java:107)
    at org.jruby.RubyKernel.rbCatch19Common(RubyKernel.java:1289)
    at org.jruby.RubyKernel.rbCatch19(RubyKernel.java:1282)
    at org.jruby.RubyKernel$INVOKER$s$rbCatch19.call(RubyKernel$INVOKER$s$rbCatch19.gen)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:336)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:179)
    at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:188)
    at org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
    at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:182)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:225)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:214)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:204)
    at org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.WhenOneArgNode.whenSlowTest(WhenOneArgNode.java:36)
    at org.jruby.ast.WhenOneArgNode.when(WhenOneArgNode.java:46)
    at org.jruby.ast.CaseNode.interpret(CaseNode.java:132)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.RootNode.interpret(RootNode.java:129)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:121)
    at org.jruby.Ruby.runInterpreter(Ruby.java:838)
    at org.jruby.Ruby.loadFile(Ruby.java:2750)
    at org.jruby.runtime.load.ExternalScript.load(ExternalScript.java:66)
    at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:959)
    at org.jruby.runtime.load.LoadService.smartLoadInternal(LoadService.java:573)
    at org.jruby.runtime.load.LoadService.requireCommon(LoadService.java:457)
    at org.jruby.runtime.load.LoadService.require(LoadService.java:421)
    at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1089)
    at org.jruby.RubyKernel.require19(RubyKernel.java:1083)
    at org.jruby.RubyKernel$INVOKER$s$1$0$require19.call(RubyKernel$INVOKER$s$1$0$require19.gen)
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350)
    at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
    at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170)
    at bin.rails.__file__(bin/rails:4)
    at bin.rails.load(bin/rails)
    at org.jruby.Ruby.runScript(Ruby.java:811)
    at org.jruby.Ruby.runScript(Ruby.java:804)
    at org.jruby.Ruby.runNormally(Ruby.java:673)
    at org.jruby.Ruby.runFromMain(Ruby.java:522)
    at org.jruby.Main.doRunFromMain(Main.java:395)
    at org.jruby.Main.internalRun(Main.java:290)
    at org.jruby.Main.run(Main.java:217)
    at org.jruby.Main.main(Main.java:197)

I'm using jRuby 1.7.10 but I've also tested it on an older version of jRuby (1.7.5) in case it broke between versions, but that is still broken.

My assumption is it's a break within nokogiri as the stack trace does not have any reference to either my code, or the ViewPoint code, but I can't be sure.

@jvshahid
Copy link
Member

jvshahid commented Feb 1, 2014

This seems to be a behavior triggered by the xml document that you're trying to parse. Is it possible to paste a minimal xml document that reproduces this behavior ?

@pareeohnos
Copy link
Author

hmm not easily. I'm not providing the XML. The XML is generated by the ViewPoint library as a soap request object, so I don't know what XML is being produced

@pareeohnos
Copy link
Author

So I've done some more digging, it seems that the nullpointerexpection that I'm getting is coming from this bit of code

builder.FindFolder(:Traversal => opts[:traversal].to_s.camel_case) {
        builder.parent.default_namespace = @default_ns
        ....
}

In particular, the error is coming from the setting of the default namespace. If i remove that line then the error goes away (except that a new error appears after but I'm hoping that it's related to this)

The @default_ns variable is set to "http://schemas.microsoft.com/exchange/services/2006/messages"

@pareeohnos
Copy link
Author

Another update. I've managed to work around this now, as it seemed to primary be issues with the library I was using, however I'm still confused why it stopped working with the update to JRuby. The main issue was due to the library I'm using not having the @default_ns variable set for the one class, which it did when using mri ruby, so that is unusual but that's an issue with the library, not Nokogiri.

Where I'm not sure about however, is in the namespace setting. The library I'm using starts building with the following

builder.Envelope(NAMESPACES) do |node|
    node.parent.namespace = node.parent.namespace_definitions.find {|ns| ns.prefix == NS_SOAP}
    node.Header {
        ....
    }
    node.Body {
        ....
    }
end
builder.doc

Previously on mri ruby, this had no issues, but after solving the first problem, this code then had an issue that the header and body tags did not have a namespace prefix.

Is this an issue with the Java implementation that the namespace must be explicitly defined, or is this something else? I've currently monkey patched it to the following which seems to now be working

builder.Envelope(NAMESPACES) do |node|
    ns = node.parent.namespace_definitions.find {|ns| ns.prefix == NS_SOAP}
    node.parent.namespace = ns
    node[ns.prefix].Header {
        ....
    }
    node[ns.prefix].Body {
        ....
    }
end
builder.doc

Is this the correct way of doing things or is this still likely to have issues?

@jvshahid
Copy link
Member

I had a fix for the null pointer exception on the https://github.com/sparklemotion/nokogiri/tree/fix-1039 branch. This fixes the null pointer exception, but I looked at the two docs generated by JRuby and MRI and there are slight differences in the namespaces that I'd like to write tests for and fix before merging this branch.

@pareeohnos
Copy link
Author

Ah great! I'll keep my patch in for now and then hopefully this will fix the issues I was having completely :)

@flavorjones
Copy link
Member

@pareeohnos Is this still happening for you? Without a test to reproduce your issue, I can't be sure that @jvshahid's fix actually works.

@flavorjones
Copy link
Member

I've rebased @jvshahid's change onto master and pushed it. Will be in the next version, I hope it fixes your issue!

@pareeohnos
Copy link
Author

Thanks for the update @flavorjones
I can't really comment on if it's fixed however. I'm no longer working at the same place so don't have access to the code that was causing the issue so will assume it's resolved :) If I or anyone else runs into the issue later I'm sure this could be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants