Hello,

I noticed that my database.yml had this

  adapter: postgresql

Instead of this

  adapter: jdbc

In both my db configs.  I changed them, but am getting a similar error:

Jan 4, 2008 3:00:05 PM org.apache.catalina.core.ApplicationContext log
INFO: Failed to load Rails: The driver encountered an error:
java.lang.NullPointerException: null
        
/opt/local/share/java/tomcat5/webapps/trunk/vendor/rails/activerecord/lib/..
/../activesupport/lib/active_support/dependencies.rb:499:in `require'
        
/opt/local/share/java/tomcat5/webapps/trunk/vendor/plugins/opus/init.rb:12:i
n `binding'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/rails/plugin.rb:79:in `eval'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/rails/plugin.rb:79:in `evaluate_init_rb'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/rails/plugin.rb:39:in `silence_warnings'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/rails/plugin.rb:75:in `evaluate_init_rb'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/rails/plugin.rb:39:in `load'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/rails/plugin/loader.rb:33:in `load_plugins'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/initializer.rb:189:in `each'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/rails/plugin/loader.rb:32:in `load_plugins'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/initializer.rb:189:in `load_plugins'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/initializer.rb:105:in `process'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/initializer.rb:49:in `send'
        
/opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
lib/initializer.rb:49:in `run'
        /opt/local/share/java/tomcat5/webapps/trunk/config/environment.rb:19
        :1

I do have this in my config/environment.rb:

if RUBY_PLATFORM =~ /java/
  require 'rubygems'
  gem 'ActiveRecord-JDBC'
  require 'jdbc_adapter'
end


On 1/4/08 2:24 PM, "Chris Lamey" <[EMAIL PROTECTED]> wrote:

> Hey guys,
> 
> I'm not sure this is the right place for this question, so I apologize in
> advance if it is not.  And if it isn't, I would appreciate some direction on
> where to go.
> 
> I'm using Goldspike to create a war from a rails app.  The 'rake
> war:standalone:create' command generates trunk.war just fine.  I then copy
> that into my $CATALINA_HOME/webapps directory and startup Tomcat.  Tomcat
> starts ok, nothing in catalina.out, but I get this in my
> logs/localhost.2008-01-04.log:
> 
> Jan 4, 2008 2:06:10 PM org.apache.catalina.core.ApplicationContext log
> INFO: Ruby is running in standalone mode
> Jan 4, 2008 2:06:12 PM org.apache.catalina.core.ApplicationContext log
> INFO: JRuby init time: 1313ms
> Jan 4, 2008 2:06:18 PM org.apache.catalina.core.ApplicationContext log
> INFO: Failed to load Rails: no such file to load -- postgres
>         
> /opt/local/share/java/tomcat5/webapps/trunk/vendor/rails/activerecord/lib/..
> /../activesupport/lib/active_support/dependencies.rb:499:in `require'
> /opt/local/share/java/tomcat5/webapps/trunk/vendor/plugins/opus/init.rb:12:i
> n `binding' 
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/rails/plugin.rb:79:in `eval'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/rails/plugin.rb:79:in `evaluate_init_rb'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/rails/plugin.rb:39:in `silence_warnings'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/rails/plugin.rb:75:in `evaluate_init_rb'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/rails/plugin.rb:39:in `load'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/rails/plugin/loader.rb:33:in `load_plugins'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/initializer.rb:189:in `each'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/rails/plugin/loader.rb:32:in `load_plugins'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/initializer.rb:189:in `load_plugins'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/initializer.rb:105:in `process'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/initializer.rb:49:in `send'
> /opt/local/share/java/tomcat5/webapps/trunk/config/../vendor/rails/railties/
> lib/initializer.rb:49:in `run'
>         /opt/local/share/java/tomcat5/webapps/trunk/config/environment.rb:19
>         :1
> 
> The vendor/plugins/opus/init.rb:12 line looks like this:
> 
>     require 'opus/language'
> 
> I have the postgres gem listed in config/war.rb and it gets packaged like
> so:
> 
>     WEB-INF/gems/gems/postgres-0.7.1
> 
> This app has two databases that it needs to talk to.  The usual 'production'
> one in database.yml, plus another one named 'opus_production' in
> database.yml.
> 
> We've subclassed ActiveRecord::Base, so that our subclass has this line:
> 
>     establish_connection "opus_#{RAILS_ENV}"
> 
> Not sure if that has any bearing in terms of Goldspike/Jruby, but it's
> different than what I've seen other folks do.
> 
> I'm really out of my element with this, what kind of things should I be
> looking at?
> 
> Thanks,
> Chris
> 
> _______________________________________________
> Jruby-extras-devel mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/jruby-extras-devel

_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to