users@glassfish.java.net

Re: information.

From: Mauro <mrsanna1_at_gmail.com>
Date: Sat, 4 Apr 2009 17:04:25 +0200

2009/4/4 Wolfram Rittmeyer <w.rittmeyer_at_jsptutorial.org>:
> Mauro wrote:
>>
>> 2009/4/4 Martin Gainty <mgainty_at_hotmail.com>:
>>>
>>> RoR is an Apache HTTP Server Script
>>> you will need to route your CGI Scripts to a servlet which can parse CGI
>>> script commands such as CGIServlet
>>>
>>> http://tomcat.apache.org/tomcat-4.1-doc/catalina/docs/api/org/apache/catalina/servlets/CGIServlet.html
>>
>> Sorry for my ignorance but.....I have read some how to in internet and
>> I've understood that all that I have to do is to create a war
>> application, with warbler, and deploy it under glassfish or tomcat.
>> Is it so or I'm wrong?
>
> That's right. You can find some information here:
> http://wiki.jruby.org/wiki/JRuby_on_Rails_in_GlassFish
> http://blog.nicksieger.com/articles/2007/09/04/warbler-a-little-birdie-to-introduce-your-rails-app-to-java
>
> The best source for RoR and/or JRuby on GlassFish though is probably Arun
> Guptas blog:
> http://weblogs.java.net/blog/arungupta/
>
> It's best to describe your problem in more detail. Arun or others can then
> help you solve these specific issues.

Then....I create a rails application with netbeans.
Jruby is 1.2.0 that comes with netbeans 6.7 M3.
Install warbler.
Than I comment out config.frameworks -= [ :active_record,
:active_resource, :action_mailer ] because I don't have to use any
database.
Create controller say hello.
At this point I run, from inside netbeans, the rake task to create a war file.
I run glassfish v3, go in administration console and deploy the war file.
It seems to work because http://localhost:8080/Hello show me the
welcome page of rails.
But when I try to launch http://localhost:8080/say/hello it says:
"
We're sorry, but something went wrong.

We've been notified about this issue and we'll take a look at it shortly.

Server.log show a lot of errors.
Some of these are:
"[#|2009-04-04T16:59:51.090+0200|SEVERE|glassfish|null|_ThreadID=17;_ThreadName=Thread-3;|/home/mauro/glassfish-v3-prelude/glassfish/domains/domain1/applications/Hello/WEB-INF/gems/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack.rb:17
warning: already initialized constant VERSION
|#]

[#|2009-04-04T16:59:53.276+0200|SEVERE|glassfish|javax.enterprise.system.container.web|_ThreadID=17;_ThreadName=Thread-3;|WebModule[/Hello]unable
to create shared application instance
org.jruby.rack.RackInitializationException: uninitialized constant
ActionController::Session::JavaServletStore
  from /home/mauro/glassfish-v3-prelude/glassfish/domains/domain1/applications/Hello/WEB-INF/gems/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in
`const_missing_with_dependencies'
  from /home/mauro/glassfish-v3-prelude/glassfish/domains/domain1/applications/Hello/WEB-INF/gems/gems/actionpack-2.3.2/lib/action_controller/session_management.rb:18:in
`session_store='
  from /home/mauro/glassfish-v3-prelude/glassfish/domains/domain1/generated/jsp/Hello/loader/jruby/rack/rails.rb:58:in
`setup_actionpack'
  from /home/mauro/glassfish-v3-prelude/glassfish/domains/domain1/generated/jsp/Hello/loader/jruby/rack/rails.rb:47:in
`require_frameworks_with_servlet_env'


....and more.
Please help because I'm in stand by.