I am sorry I did not put a subject in my previous email.
I am getting a very weird error when using
ActiveRecord::establish_connection to establish a connection on the fly
to
an MS SQL 2005 server database using jdbc:
DatabaseAccessor.establish_connection(:adapter => “jdbc”,
:url => @custom_values.db_conn_str,
:driver => @custom_values.jdbc_driver,
:username => @custom_values.db_user_str,
:password => @custom_values.db_pass_str)
I get the following when trying to use find_by_sql on DatabaseAccessor
after the code above:
Exception in thread “Ruby Thread32032133” java.lang.NullPointerException
at
jdbc_adapter.JdbcAdapterInternalService.set_native_database_types(JdbcAdapterInternalService.java:359)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:141)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:70)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:117)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:275)
at
org.jruby.evaluator.ASTInterpreter.vcallNode(ASTInterpreter.java:1748)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:484)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.rescueNode(ASTInterpreter.java:1517)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:452)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at org.jruby.RubyClass.invoke(RubyClass.java:236)
at
org.jruby.javasupport.util.RuntimeHelpers.invoke(RuntimeHelpers.java:314)
at org.jruby.RubyObject.callMethod(RubyObject.java:475)
at org.jruby.RubyClass.newInstance(RubyClass.java:271)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:143)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:102)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:243)
at
org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:657)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:308)
at
org.jruby.evaluator.ASTInterpreter.localAsgnNode(ASTInterpreter.java:1256)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:387)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at org.jruby.RubyObject.send(RubyObject.java:1173)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:143)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:102)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:243)
at
org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:657)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:308)
at
org.jruby.evaluator.ASTInterpreter.setupArgs(ASTInterpreter.java:2155)
at
org.jruby.evaluator.ASTInterpreter.attrAssignNode(ASTInterpreter.java:582)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:293)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at
org.jruby.evaluator.ASTInterpreter.attrAssignNode(ASTInterpreter.java:598)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:293)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:70)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:117)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:275)
at
org.jruby.evaluator.ASTInterpreter.vcallNode(ASTInterpreter.java:1748)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:484)
at
org.jruby.evaluator.ASTInterpreter.rootNode(ASTInterpreter.java:1615)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:458)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.evaluator.ASTInterpreter.evalWithBinding(ASTInterpreter.java:222)
at org.jruby.RubyKernel.eval(RubyKernel.java:715)
at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:141)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:240)
at
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1100)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:354)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
at org.jruby.runtime.Block.yield(Block.java:114)
at
org.jruby.evaluator.ASTInterpreter.yieldNode(ASTInterpreter.java:1817)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:493)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.ensureNode(ASTInterpreter.java:1072)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:348)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:253)
at
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1105)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:354)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.rescueNode(ASTInterpreter.java:1517)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:452)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:240)
at
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1100)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:354)
at
org.jruby.evaluator.ASTInterpreter.localAsgnNode(ASTInterpreter.java:1256)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:387)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:102)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:243)
at
org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:657)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:308)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
at
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:115)
at org.jruby.runtime.Block.yield(Block.java:109)
at org.jruby.RubyArray.each(RubyArray.java:1179)
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:143)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:253)
at
org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:662)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:308)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
at
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:115)
at org.jruby.runtime.Block.yield(Block.java:109)
at org.jruby.RubyKernel.rbCatch(RubyKernel.java:743)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:141)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:253)
at
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1105)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:354)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:240)
at
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1100)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:354)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
at
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:115)
at org.jruby.runtime.Block.yield(Block.java:109)
at org.jruby.RubyKernel.rbCatch(RubyKernel.java:743)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:141)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:253)
at
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1105)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:354)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.whileNode(ASTInterpreter.java:1761)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:489)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.rescueNode(ASTInterpreter.java:1517)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:452)
at
org.jruby.evaluator.ASTInterpreter.ensureNode(ASTInterpreter.java:1072)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:348)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:176)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:102)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:243)
at
org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:657)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:308)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.rescueNode(ASTInterpreter.java:1517)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:452)
at
org.jruby.evaluator.ASTInterpreter.whileNode(ASTInterpreter.java:1761)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:489)
at
org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:631)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:302)
at
org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
at
org.jruby.runtime.InterpretedBlock.call(InterpretedBlock.java:103)
at org.jruby.runtime.Block.call(Block.java:105)
at org.jruby.RubyProc.call(RubyProc.java:203)
at org.jruby.RubyProc.call(RubyProc.java:182)
at
org.jruby.internal.runtime.RubyNativeThread.run(RubyNativeThread.java:72)
The program crashes in the connection method of ActiveRecord::Base.
I am using jruby 1.1.1 and the latest jdbc active record and rails gems.
Any suggestions??
Best regards,
Juan P. Tarquino
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email