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 21:33:48 -0700

I didn't just check the DAS. My application was already deployed there.

What I did was push it out to a separate (non-DAS) standalone instance I
already had running. Since my application uses a JDBC resource, I
needed to push the resource out to that instance as well. It worked fine.

I didn't check a clustered instance, but I have no reason to believe
that wouldn't work since in this context there is little difference
between a clustered instance and a standalone instance.

There nothing unique about GlassFish I'm aware of that would prevent you
from doing what you describe but you will probably have to investigate
that exception more and find out what the cause was.

-Peter

Rich Smith wrote:
> Thanks for the info Peter.
>
> This application will deploy to the DAS as well but what I'm looking
> for is deploying to a more distributed network of systems.
>
> We already have a Glassfish infrastructure with several servers being
> controlled by a central DAS server via node agents. What I was hoping
> for was to use that managed infrastructure to manage a set of
> application servers and designate them to be JRuby targets. We already
> have some designated as Web Services and others are doing
> Struts/MyFaces applications.
>
> Anyone tried anything like for the JRuby on Rails side?
>
> Thanks,
> Rich
>
>
>
> On 17-Mar-09, at 8:54 PM, Peter Williams wrote:
>
>> 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
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>