users@glassfish.java.net

Re: Deploying jRuby applications to glassfish v2.1

From: Peter Williams <Pete.Williams_at_Sun.COM>
Date: Tue, 17 Mar 2009 17:54:07 -0700

Well, since I already had a simple JRuby app wrapped up with Warbler,
using jdbc to talk to PostgreSQL and deployed to my V2.1 DAS, I checked
this out.

It works against a standalone instance fine. All I had to do was
retarget the JDBC resource to my standalone instance and enable it
(don't ask me why it's not enabled by default, but it isn't), then
retarget the WAR file to the standalone instance, and voila, perfecto.

I'm not sure what the caused of your exception below. It does generally
work if configured correctly.

Good luck.
-Peter

Rich Smith wrote:
> Hi All:
>
> I'm having problems deploying a jRuby application to Glassfish v2.1.
> It looks like I can sdeploy a JRuby application to the "server"
> instance but in a multi-node multi -cluster environment it appears
> that if I attempt to deploy a JRuby application to an instances that
> is controlled via a node agent I get a rails error:
>
> application initialization failed javax.servlet.ServletException:
> org.jruby.rack.RackInitializationException: undefined method
> `delegate' for ActiveRecord::NamedScope::Scope:Class
> at
> WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/named_scope.rb:105:in
> `each'
> at
> WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/named_scope.rb:105
> at
> WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/named_scope.rb:31:in
> `require'
> at
> loader/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
> at WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record.rb:35
> at WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record.rb:31:in
> `require'
> at
> loader/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
> `require'
> at WEB-INF/gems/gems/rails-2.2.2/lib/initializer.rb:256:in
> `require_frameworks' ... 10 levels...
> at loader/rack/builder.rb:22:in `instance_eval'
> at loader/rack/builder.rb:22:in `initialize'
> .....
>
> Has anyone got Ruby on Rails apps deployed to an instance in Glassfish
> v2.1 that is not the "server" instance?
>
> Thanks,
> Rich
>