Hello guys,
I am working in a multithreaded algorithm to perform some complex
searches on an Oracle database. For that I am using JDBC and
activerecord-jdbc-adapter (0.8.2).
The algorithm opens six different threads. Two of them use cursors to
select data from oracle. Both threads share the same connection, but
they have independent local cursors.
The algorithm works ok, but intermittently fails with a
NullPointerException. My problem is that I cannot identify what it is
producing the error. I cannot even identify which line in the code is
producing it because I cannot catch the transaction with rescue
Exception => error. The thread just aborts.
Any ideas? This is the complete error stack:
Exception in thread “Thread-2” java.lang.NullPointerException
at
org
.jruby.runtime.ThreadContext.getClassNameFromFrame(ThreadContext.java:
809)
at org.jruby.runtime.ThreadContext.buildTrace(ThreadContext.java:796)
at
org.jruby.runtime.ThreadContext.createBacktrace2(ThreadContext.java:790)
at
org.jruby.exceptions.RaiseException.setException(RaiseException.java:
145)
at org.jruby.exceptions.RaiseException.(RaiseException.java:69)
at org.jruby.Ruby.newRaiseException(Ruby.java:2723)
at org.jruby.Ruby.newTypeError(Ruby.java:2598)
at
org
.jruby
.javasupport.JavaMethod.invokeWithExceptionHandling(JavaMethod.java:301)
at org.jruby.javasupport.JavaMethod.invoke(JavaMethod.java:259)
at
org
.jruby
.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:44)
at org.jruby.runtime.CallSite
$InlineCachingCallSite.call(CallSite.java:391)
at
ruby.jit.ruby.usr.local.jruby_minus_1_dot_1_dot_4.lib.ruby.site_ruby.
$
1_dot_8
.builtin
.java
.collections._lt_equal_gt_15351875_2166653.file(collections.rb:20)
at
org
.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:
265)
at org.jruby.RubyClass.finvoke(RubyClass.java:362)
at
org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:
326)
at org.jruby.RubyObject.callMethod(RubyObject.java:732)
at org.jruby.RubyComparable.op_equal(RubyComparable.java:107)
at org.jruby.RubyComparable$s_method_1_0$RUBYINVOKER
$op_equal.call(org/jruby/RubyComparable$s_method_1_0$RUBYINVOKER
$op_equal.gen)
at org.jruby.runtime.CallSite
$InlineCachingCallSite.call(CallSite.java:391)
at search_engine.iqsearch.rescue_10$RUBY$rescue(iqsearch.rb:345)
at search_engine.iqsearch.method__39$RUBY
$search_leaf_thread(iqsearch.rb)
at search_engine.iqsearchInvokermethod__39$RUBY
$search_leaf_threadFixed0.call(search_engine/
iqsearchInvokermethod__39$RUBY$search_leaf_threadFixed0.gen)
at
org
.jruby
.internal.runtime.methods.CompiledMethod.call(CompiledMethod.java:216)
at org.jruby.runtime.CallSite
$InlineCachingCallSite.cacheAndCall(CallSite.java:132)
at org.jruby.runtime.CallSite
$InlineCachingCallSite.call(CallSite.java:343)
at search_engine.iqsearch.block_2$RUBY$block(iqsearch.rb:224)
at search_engine.iqsearchBlockCallback$block_2$RUBY
$__block__xx1.call(Unknown Source)
at org.jruby.runtime.CompiledBlock.yield(CompiledBlock.java:120)
at org.jruby.runtime.BlockBody.call(BlockBody.java:64)
at org.jruby.runtime.Block.call(Block.java:101)
at org.jruby.RubyProc.call(RubyProc.java:200)
at org.jruby.RubyProc.call(RubyProc.java:187)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:90)
at java.lang.Thread.run(Thread.java:613)
Thanks,
GA