I'll go ahead and complete the process that you've outlined and see if
I can narrow it down.
In the meantime here's the complete trace of the error.

Nov 1, 2010 7:10:45 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Application Error
org.jruby.rack.RackInitializationException: ActiveRecord::JDBCError:
Generated keys not requested. You need to specify
Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or
Connection.prepareStatement().: SET SQL_AUTO_IS_NULL=0
        from /Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-
jdbc-adapter-1.0.2-java/lib/arjdbc/jdbc/adapter.rb:178:in `execute'
        from /Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-
jdbc-adapter-1.0.2-java/lib/arjdbc/mysql/adapter.rb:14:in
`configure_connection'
        from /Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-
jdbc-adapter-1.0.2-java/lib/arjdbc/mysql/adapter.rb:385:in
`initialize'
        from /Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-
jdbc-adapter-1.0.2-java/lib/arjdbc/jdbc/connection_methods.rb:6:in
`new'
        from /Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-
jdbc-adapter-1.0.2-java/lib/arjdbc/jdbc/connection_methods.rb:6:in
`jdbc_connection'
        from /Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-
jdbc-adapter-1.0.2-java/lib/arjdbc/mysql/connection_methods.rb:18:in
`mysql_connection'
        from /Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
activerecord-3.0.1/lib/active_record/connection_adapters/abstract/
connection_pool.rb:230:in `new_connection'
        from /Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
activerecord-3.0.1/lib/active_record/connection_adapters/abstract/
connection_pool.rb:238:in `checkout_new_connection'
         ... 50 levels...
        from file:/Library/Tomcat/apache-tomcat-6.0.29/webapps/RSM/WEB-INF/
lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46:in
`initialize'
        from <script>:2:in `new'
        from <script>:2

        at org.jruby.rack.DefaultRackApplicationFactory
$4.init(DefaultRackApplicationFactory.java:184)
        at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:
59)
        at
org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:
94)
        at
org.jruby.rack.servlet.DefaultServletDispatcher.process(DefaultServletDispatcher.java:
36)
        at org.jruby.rack.RackFilter.doFilter(RackFilter.java:59)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
235)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
191)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
127)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
298)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
857)
        at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:588)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
489)
        at java.lang.Thread.run(Thread.java:680)
Caused by: org.jruby.exceptions.RaiseException:
ActiveRecord::JDBCError: Generated keys not requested. You need to
specify Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate()
or Connection.prepareStatement().: SET SQL_AUTO_IS_NULL=0
        at Kernel.raise(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
activerecord-3.0.1/lib/active_record/connection_adapters/
abstract_adapter.rb:202)
        at ActiveRecord::ConnectionAdapters::AbstractAdapter.log(/Library/
Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-jdbc-
adapter-1.0.2-java/lib/arjdbc/jdbc/adapter.rb:178)
        at ActiveRecord::ConnectionAdapters::JdbcAdapter.execute(/Library/
Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-jdbc-
adapter-1.0.2-java/lib/arjdbc/mysql/adapter.rb:14)
        at ArJdbc::MySQL.configure_connection(/Library/Tomcat/Home/webapps/
RSM/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.0.2-java/lib/arjdbc/
mysql/adapter.rb:385)
        at ActiveRecord::ConnectionAdapters::MysqlAdapter.initialize(/Library/
Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-jdbc-
adapter-1.0.2-java/lib/arjdbc/jdbc/connection_methods.rb:6)
        at (unknown).new(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
activerecord-jdbc-adapter-1.0.2-java/lib/arjdbc/jdbc/
connection_methods.rb:6)
        at #<Class:01x1aff2be8>.jdbc_connection(/Library/Tomcat/Home/webapps/
RSM/WEB-INF/gems/gems/activerecord-jdbc-adapter-1.0.2-java/lib/arjdbc/
mysql/connection_methods.rb:18)
        at #<Class:01x1aff2be8>.mysql_connection(/Library/Tomcat/Home/webapps/
RSM/WEB-INF/gems/gems/activerecord-3.0.1/lib/active_record/
connection_adapters/abstract/connection_pool.rb:230)
        at ActiveRecord::ConnectionAdapters::ConnectionPool.new_connection(/
Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-3.0.1/
lib/active_record/connection_adapters/abstract/connection_pool.rb:238)
        at
ActiveRecord::ConnectionAdapters::ConnectionPool.checkout_new_connection(/
Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-3.0.1/
lib/active_record/connection_adapters/abstract/connection_pool.rb:194)
        at ActiveRecord::ConnectionAdapters::ConnectionPool.checkout(/Library/
Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-3.0.1/lib/
active_record/connection_adapters/abstract/connection_pool.rb:190)
        at Kernel.loop(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
activerecord-3.0.1/lib/active_record/connection_adapters/abstract/
connection_pool.rb:190)
        at ActiveRecord::ConnectionAdapters::ConnectionPool.checkout(file:/
Library/Tomcat/apache-tomcat-6.0.29/webapps/RSM/WEB-INF/lib/jruby-
stdlib-1.5.3.jar!/META-INF/jruby.home/lib/ruby/1.8/monitor.rb:191)
        at MonitorMixin.mon_synchronize(/Library/Tomcat/Home/webapps/RSM/WEB-
INF/gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/
abstract/connection_pool.rb:189)
        at ActiveRecord::ConnectionAdapters::ConnectionPool.checkout(/Library/
Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-3.0.1/lib/
active_record/connection_adapters/abstract/connection_pool.rb:96)
        at ActiveRecord::ConnectionAdapters::ConnectionPool.connection(/
Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-3.0.1/
lib/active_record/connection_adapters/abstract/connection_pool.rb:318)
        at
ActiveRecord::ConnectionAdapters::ConnectionHandler.retrieve_connection(/
Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activerecord-3.0.1/
lib/active_record/connection_adapters/abstract/
connection_specification.rb:97)
        at #<Class:01x1aff2be8>.retrieve_connection(/Library/Tomcat/Home/
webapps/RSM/WEB-INF/gems/gems/activerecord-3.0.1/lib/active_record/
connection_adapters/abstract/connection_specification.rb:89)
        at #<Class:01x1aff2be8>.connection(/Library/Tomcat/Home/webapps/RSM/
WEB-INF/gems/gems/arel-1.0.1/lib/arel/engines/sql/engine.rb:9)
        at Arel::Sql::Engine.connection(/Library/Tomcat/Home/webapps/RSM/WEB-
INF/gems/gems/arel-1.0.1/lib/arel/engines/sql/relations/table.rb:37)
        at Arel::Table.initialize(/Library/Tomcat/Home/webapps/RSM/WEB-INF/
gems/gems/activerecord-3.0.1/lib/active_record/base.rb:850)
        at (unknown).new(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
activerecord-3.0.1/lib/active_record/base.rb:850)
        at #<Class:01x1aff2be8>.arel_table(/Library/Tomcat/Home/webapps/RSM/
WEB-INF/gems/gems/activerecord-3.0.1/lib/active_record/base.rb:896)
        at #<Class:01x1aff2be8>.relation(/Library/Tomcat/Home/webapps/RSM/WEB-
INF/gems/gems/activerecord-3.0.1/lib/active_record/named_scope.rb:32)
        at ActiveRecord::NamedScope::ClassMethods.scoped(/Library/Tomcat/Home/
webapps/RSM/WEB-INF/gems/gems/activerecord-3.0.1/lib/active_record/
base.rb:441)
        at #<Class:01x1aff2be8>.limit(/Library/Tomcat/apache-tomcat-6.0.29/
webapps/RSM/WEB-INF/app/models/artist.rb:5)
        at (unknown).(unknown)(/Library/Tomcat/apache-tomcat-6.0.29/webapps/
RSM/WEB-INF/app/models/artist.rb:239)
        at (unknown).(unknown)(/Library/Tomcat/apache-tomcat-6.0.29/webapps/
RSM/WEB-INF/app/models/artist.rb:239)
        at Kernel.require(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
activesupport-3.0.1/lib/active_support/dependencies.rb:239)
        at ActiveSupport::Dependencies::Loadable.require(/Library/Tomcat/Home/
webapps/RSM/WEB-INF/gems/gems/activesupport-3.0.1/lib/active_support/
dependencies.rb:227)
        at ActiveSupport::Dependencies::Loadable.load_dependency(/Library/
Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activesupport-3.0.1/lib/
active_support/dependencies.rb:239)
        at ActiveSupport::Dependencies::Loadable.require(/Library/Tomcat/Home/
webapps/RSM/WEB-INF/gems/gems/activesupport-3.0.1/lib/active_support/
dependencies.rb:346)
        at ActiveSupport::Dependencies.require_or_load(/Library/Tomcat/Home/
webapps/RSM/WEB-INF/gems/gems/activesupport-3.0.1/lib/active_support/
dependencies.rb:300)
        at ActiveSupport::Dependencies.depend_on(/Library/Tomcat/Home/webapps/
RSM/WEB-INF/gems/gems/activesupport-3.0.1/lib/active_support/
dependencies.rb:216)
        at ActiveSupport::Dependencies::Loadable.require_dependency(/Library/
Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/railties-3.0.1/lib/rails/
engine.rb:138)
        at Rails::Engine.eager_load!(/Library/Tomcat/Home/webapps/RSM/WEB-INF/
gems/gems/railties-3.0.1/lib/rails/engine.rb:137)
        at Array.each(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
railties-3.0.1/lib/rails/engine.rb:137)
        at Rails::Engine.eager_load!(/Library/Tomcat/Home/webapps/RSM/WEB-INF/
gems/gems/railties-3.0.1/lib/rails/engine.rb:135)
        at Array.each(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
railties-3.0.1/lib/rails/engine.rb:135)
        at Rails::Engine.eager_load!(/Library/Tomcat/Home/webapps/RSM/WEB-INF/
gems/gems/railties-3.0.1/lib/rails/application.rb:108)
        at Rails::Application.eager_load!(/Library/Tomcat/Home/webapps/RSM/
WEB-INF/gems/gems/railties-3.0.1/lib/rails/application/finisher.rb:41)
        at (unknown).(unknown)(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/
gems/railties-3.0.1/lib/rails/initializable.rb:25)
        at Kernel.instance_exec(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/
gems/railties-3.0.1/lib/rails/initializable.rb:25)
        at Kernel.instance_exec(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/
gems/railties-3.0.1/lib/rails/initializable.rb:25)
        at Rails::Initializable::Initializer.run(/Library/Tomcat/Home/webapps/
RSM/WEB-INF/gems/gems/railties-3.0.1/lib/rails/initializable.rb:50)
        at Rails::Initializable.run_initializers(/Library/Tomcat/Home/webapps/
RSM/WEB-INF/gems/gems/railties-3.0.1/lib/rails/initializable.rb:49)
        at Array.each(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
railties-3.0.1/lib/rails/initializable.rb:49)
        at Rails::Initializable.run_initializers(/Library/Tomcat/Home/webapps/
RSM/WEB-INF/gems/gems/railties-3.0.1/lib/rails/application.rb:134)
        at Rails::Application.initialize!(/Library/Tomcat/Home/webapps/RSM/
WEB-INF/gems/gems/railties-3.0.1/lib/rails/application.rb:77)
        at #<Class:01x4856d15d>.method_missing(/Library/Tomcat/apache-
tomcat-6.0.29/webapps/RSM/WEB-INF/config/environment.rb:9)
        at (unknown).(unknown)(/Library/Tomcat/apache-tomcat-6.0.29/webapps/
RSM/WEB-INF/config/environment.rb:239)
        at Kernel.require(/Library/Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/
activesupport-3.0.1/lib/active_support/dependencies.rb:239)
        at ActiveSupport::Dependencies::Loadable.require(/Library/Tomcat/Home/
webapps/RSM/WEB-INF/gems/gems/activesupport-3.0.1/lib/active_support/
dependencies.rb:225)
        at ActiveSupport::Dependencies::Loadable.load_dependency(/Library/
Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activesupport-3.0.1/lib/
active_support/dependencies.rb:591)
        at ActiveSupport::Dependencies.new_constants_in(/Library/Tomcat/Home/
webapps/RSM/WEB-INF/gems/gems/activesupport-3.0.1/lib/active_support/
dependencies.rb:225)
        at ActiveSupport::Dependencies::Loadable.load_dependency(/Library/
Tomcat/Home/webapps/RSM/WEB-INF/gems/gems/activesupport-3.0.1/lib/
active_support/dependencies.rb:239)
        at ActiveSupport::Dependencies::Loadable.require(file:/Library/Tomcat/
apache-tomcat-6.0.29/webapps/RSM/WEB-INF/lib/jruby-rack-1.0.3.jar!/
jruby/rack/rails.rb:161)
        at JRuby::Rack::RailsBooter::Rails3Environment.load_environment(file:/
Library/Tomcat/apache-tomcat-6.0.29/webapps/RSM/WEB-INF/lib/jruby-
rack-1.0.3.jar!/jruby/rack/rails.rb:165)
        at JRuby::Rack::RailsBooter::Rails3Environment.to_app(file:/Library/
Tomcat/apache-tomcat-6.0.29/webapps/RSM/WEB-INF/lib/jruby-
rack-1.0.3.jar!/jruby/rack/rails.rb:186)
        at #<Class:01x49450f34>.new(<script>:2)
        at (unknown).(unknown)(file:/Library/Tomcat/apache-tomcat-6.0.29/
webapps/RSM/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/
builder.rb:46)
        at Kernel.instance_eval(file:/Library/Tomcat/apache-tomcat-6.0.29/
webapps/RSM/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/
builder.rb:46)
        at Kernel.instance_eval(file:/Library/Tomcat/apache-tomcat-6.0.29/
webapps/RSM/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/
builder.rb:46)
        at Rack::Builder.initialize(<script>:2)
        at (unknown).new(<script>:2)
        at (unknown).(unknown)(:1)

Thanks.

On Nov 1, 7:48 pm, mkristian <[email protected]> wrote:
> first I have to mention warble produces a production environment, so
> maybe you need to somehting like
> $ jruby -S rake :db:setup
>
> then you can use the ruby-maven gem
> $ jruby -S gem install ruby-maven --pre
> which comes with jetty setup which you can just start with
> $ jetty-run
> and this runs in development mode or for production
> $ jetty-run -e production
> and of course to compare you should also see that webrick works in
> production mode
> $ jruby rails s -e production
> and then with the ruby-maven gem you can produces another warfile
> which might be slightly different from what warble produces (target/
> XZY.war):
> $ rmvn package
>
> with this we should be able to see whether this is tomcat or the
> servlet stack as such (since we can compare it jetty). is that all the
> stacktrace you get, can you increase logging on production - maybe
> there is more to see.
>
> let's see if this helps to narrow down the issue
>
> regards, Kristian
>
> On Nov 2, 7:06 am, MJW2529 <[email protected]> wrote:
>
> > Thanks for your help so far Kristan.  I've put the entries that you
> > suggested into my Gemfile and redeployed to Tomcat but I still get the
> > following error back.
> > SEVERE: Application Error
> > org.jruby.rack.RackInitializationException: ActiveRecord::JDBCError:
> > Generated keys not requested. You need to specify
> > Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or
> > Connection.prepareStatement().: SET SQL_AUTO_IS_NULL=0
>
> > When I deploy this under the WEBrick server it runs fine (although I
> > not creating a war file for the WEBrick server).
> > Is there anyway to ensure that the deployed war file is using the same
> > stack as my development environment?
> > Thanks.
>
> > On Nov 1, 1:21 pm, mkristian <[email protected]> wrote:
>
> > > my typical Gemfile starts like this and works without a problem with
> > > jetty and your error does not look tomcat-related. I would not use
> > > config.gems just add the gems you need in Gemfile.
>
> > > # -*- mode: ruby -*-
> > > source 'http://rubygems.org'
>
> > > gem 'rails', '3.0.0'
>
> > > # Bundle edge Rails instead:
> > > # gem 'rails', :git => 'git://github.com/rails/rails.git'
>
> > > gem 'mysql2', :require => 'sqlite3' unless defined?(JRUBY_VERSION)
> > > gem "activerecord-jdbc-adapter" if defined?(JRUBY_VERSION)
> > > gem "jdbc-mysql", :require => false if defined?(JRUBY_VERSION)
>
> > > in my Gemfile.lock I see
> > >     activerecord-jdbc-adapter (0.9.4-java)
>
> > > maybe that setup helps.
> > > regards, Kristian
>
> > > On Nov 1, 9:47 am, MJW2529 <[email protected]> wrote:
>
> > > > I setup the war file with warbler.  Here's the Gemfile:
>
> > > > source 'http://rubygems.org'
> > > > gem 'rails', '3.0.1'
>
> > > > # Bundle edge Rails instead:
> > > > # gem 'rails', :git => 'git://github.com/rails/rails.git'
>
> > > > #gem 'sqlite3-ruby', :require => 'sqlite3'
> > > > gem "activerecord-jdbcmysql-adapter", '1.0.2', :require =>'arjdbc' if
> > > > defined?(JRUBY_VERSION)
>
> > > > # Use unicorn as the web server
> > > > # gem 'unicorn'
>
> > > > # Deploy with Capistrano
> > > > # gem 'capistrano'
>
> > > > # To use debugger
> > > > # gem 'ruby-debug'
>
> > > > # Bundle the extra gems:
> > > > # gem 'bj'
> > > > # gem 'nokogiri'
> > > > # gem 'sqlite3-ruby', :require => 'sqlite3'
> > > > # gem 'aws-s3', :require => 'aws/s3'
>
> > > > # Bundle gems for the local environment. Make sure to
> > > > # put test-only gems in this group so their generators
> > > > # and rake tasks are available in development mode:
> > > > # group :development, :test do
> > > > #   gem 'webrat'
> > > > # end
>
> > > > In the config/warbler.rb file I also have the following line
> > > > uncommented:
>
> > > > config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]
>
> > > > Also, the  "jruby -S rails server" command brings up the WEBrick
> > > > server not Tomcat.
> > > > I propose to run Tomcat in the production environment.
>
> > > > On Oct 31, 12:49 am, mkristian <[email protected]> wrote:
>
> > > > > can you run
> > > > > $ jruby -S rails server
> > > > > ?
> > > > > how does your Gemfile look like ?
> > > > > how do you setup your war files ? with warbler ?
>
> > > > > regards, Kristian
>
> > > > > On Oct 30, 6:21 am, MJW2529 <[email protected]> wrote:
>
> > > > > > Hi,
> > > > > > I've been trying to get JRuby 1.5.3 with Rails 3 to run on the 
> > > > > > Tomcat6
> > > > > > server with little success.
> > > > > > Has anyone been able to do this?  If so, what issues did you have to
> > > > > > overcome to get this to work?
> > > > > > Also, is this a combination that you would recommend for a 
> > > > > > production
> > > > > > site, or is it all too new and untested?
> > > > > > The latest issue I'm stuck on right now is with the mysql-connector-
> > > > > > java-5.0.4 which comes with jruby 1.5.3 which keeps returning
> > > > > > JDBCError: Generated keys not requested.
> > > > > > Any feedback on this would be appreciated.
> > > > > > Thanks.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to