Ruby on Rails Monday, November 1, 2010

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 <meier.krist...@gmail.com> 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 <mjwhite2...@yahoo.com> 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 <meier.krist...@gmail.com> 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 <mjwhite2...@yahoo.com> 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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment