Hi,
I’m trying to deploy a very simple RoR application into a Glassfish
Server.
The problem here is that I need to protect my source code somehow, so
I’ve
compiled all models and controllers with jrubyc, hacked active_support
dependencies.rb to accept requiring .class files and removed all .rb
files.
So far I’ve been able to launch webbrick (jruby script/server) and it
works
fine.
I’ve packed the application into a war with warble, and deployed it into
Glassfish.
And when I try to access the app, I get this error:
[#|2008-11-05T12:38:39.740+0100|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=22;_ThreadName=httpSSLWorkerThread-57151-1;_RequestID=ab6f35e2-2e2c-42f6-80d1-01e836ed06b8;|WebModule[/test]Exception
caught org.jruby.rack.RackInitializationException: IO error –
/root/glassfishv2/domain1/applications/j2ee-modules/test/WEB-INF/app/controllers/application
from
/root/glassfishv2/domain1/applications/j2ee-modules/test/WEB-INF/
vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/
callbacks.rb:177:in call' from /root/glassfishv2/domain1/applications/j2ee-modules/test/WEB-INF/ vendor/rails/activerecord/lib/../../activesupport/lib/active_support/ callbacks.rb:177:in
evaluate_method’
from
/root/glassfishv2/domain1/applications/j2ee-modules/test/WEB-INF/
vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/
callbacks.rb:161:in call' from /root/glassfishv2/domain1/applications/j2ee-modules/test/WEB-INF/ vendor/rails/activerecord/lib/../../activesupport/lib/active_support/ callbacks.rb:90:in
run’
from
/root/glassfishv2/domain1/applications/j2ee-modules/test/WEB-INF/
vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/
callbacks.rb:90:in each' from /root/glassfishv2/domain1/applications/j2ee-modules/test/WEB-INF/ vendor/rails/activerecord/lib/../../activesupport/lib/active_support/ callbacks.rb:90:in
run’
from
/root/glassfishv2/domain1/applications/j2ee-modules/test/WEB-INF/
vendor/rails/activerecord/lib/…/…/activesupport/lib/active_support/
callbacks.rb:272:in run_callbacks' from /root/glassfishv2/domain1/applications/j2ee-modules/test/WEB-INF/ config/../vendor/rails/railties/lib/initializer.rb:483:in
prepare_dispatcher’
… 7 levels…
from
/root/glassfishv2/domain1/generated/jsp/j2ee-modules/test/loader/
rack/builder.rb:22:in instance_eval' from /root/glassfishv2/domain1/generated/jsp/j2ee-modules/test/loader/ rack/builder.rb:22:in
initialize’
from :3
at org.jruby.rack.DefaultRackApplicationFactory
$4.init(DefaultRackApplicationFactory.java:154)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:
53)
at
org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:
92)
at
org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:
31)
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
230)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
198)
…
I think JRuby Rack is trying to parse controllers/application but it
can’t,
mainly because it is in java bytecode. After looking a little to the
rack’s
code, the little I could understand is that it’s trying to include all
rails
app as ruby code, and then let jruby JIT compile it.
Has anyone got into this problem before? Is there any configuration I
can
use to solve this? Is it planned to make rack accept AOT code?
I’m using jruby-complete-1.1.4.jar and jruby-rack-0.9.2.jar for
glassfish
and jruby-1.1.5 for webbrick.
Thanks for your time,
Raimon Malatesta