java.lang.NullPointerException when trying to connect to a Oracle XE database
-----------------------------------------------------------------------------

                 Key: JRUBY-2329
                 URL: http://jira.codehaus.org/browse/JRUBY-2329
             Project: JRuby
          Issue Type: Bug
          Components: ActiveRecord-JDBC
    Affects Versions: JRuby 1.1RC1
         Environment: ruby 1.8.6 (2008-01-07 rev 5512) [sparc-jruby1.1RC1], 
activerecord-jdbc-adapter (0.7.1)
            Reporter: Ralf Sigmund


When attempting to connect to a DB2 database, I get the following error: 

/usr/local/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.7.1/lib/active_record/connection_adapters/jdbc_adapter.rb:303:in
 `initialize': The driver encountered an error: java.lang.NullPointerException: 
null (RuntimeError)
        from 
/usr/local/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.7.1/lib/active_record/connection_adapters/jdbc_adapter.rb:46:in
 `new'
        from 
/usr/local/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activerecord-jdbc-adapter-0.7.1/lib/active_record/connection_adapters/jdbc_adapter.rb:46:in
 `jdbc_connection'
        from 
/usr/local/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:291:in
 `connection='
        from 
/usr/local/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:259:in
 `retrieve_connection'
        from 
/usr/local/jruby-1.1RC1/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
 `connection'
        from ./rowcounts.rb:13

The script I am running is this:

require 'rubygems'
gem 'activerecord-jdbc-adapter'
require 'jdbc_adapter'
require 'active_record'

ActiveRecord::Base.establish_connection(
  :adapter => 'jdbc',
  :driver => 'COM.ibm.db2.jdbc.app.DB2Driver',
  :url => 'jdbc:db2:OSU',
  :username => 'db2inst1',
  :password => 'db2admin'
)
conn = ActiveRecord::Base.connection
puts conn.active?


Under ruby 1.8.5 (2007-11-01 rev 4842) [sparc-jruby1.1b1], 
activerecord-jdbc-adapter (0.7.1), i also error out with this message:

java.lang.NoSuchMethodError: 
org.jruby.javasupport.JavaEmbedUtils.newObjectAdapter()Lorg/jruby/RubyObjectAdapter;
[snipped 730 line stack tace, see attached file for full stack trace]

It works as expected under ruby 1.8.5 (2007-11-01 rev 4842) [sparc-jruby1.1b1], 
activerecord-jdbc-adapter (0.6)






-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to