-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Christian N. wrote:
find a way to integrate that into Warbler, that would be fantastic.
/Nick
Thanks so far Nick, I will look into this.
Just a quick note with what I have found out so far:
I used the rails example app which is provided with jruby-rack as a
testing ground.
First, I did some compilation tests so that the application can be
started with ‘jruby ./script/server’ using the compiled .class files.
I simply compiled the .rb files using the following command-line:
find app public -name “*.rb” | xargs jrubyc
As it turns out .rb Files under config/ cannot be compiled into .class
files, because for example config/boot.rb uses File.read to directly
load .rb files ( File.read(“#{RAILS_ROOT}/config/environment.rb”)) if
these are replaced with .class files rails spits out a file not found
error and the app does not work.
As jruby prefers .class files over .rb files, they can coexist.
If for example app/controller/*.rb files are missing but the compiled
classes exist instead, the application does not work, because rails
somehow needs the .rb files for routing purposes. If a controller .class
file exists without a corresponding .rb file, we get the following error
(for the snoop controller):
No route matches “/snoop” with {:method=>:get}
So as it seems .class files have to coexist with their corresponding .rb
files (at least where direct IO is used within the rails framework).
With the command-line mentioned above, I am able to compile a rails
application and then start and run it using ./script/server.
Unfortunately deploying a .war file generated by warbler does not work.
I believe that jruby-rack causes some trouble here. If the example
application is being compiled, warbled and then deployed (I use jboss
4.2.3GA) I get the following stacktrace just before the application
could be correctly initalized:
21:10:42,066 ERROR [[/rails]] Exception caught
org.jruby.rack.RackInitializationException: IO error –
/home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/app/controllers/application
from
/home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/gems/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:177:in
call' from /home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/gems/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:177:in
evaluate_method’
from
/home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/gems/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:161:in
call' from /home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/gems/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90:in
run’
from
/home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/gems/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90:in
each' from /home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/gems/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:90:in
run’
from
/home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/gems/gems/activesupport-2.1.0/lib/active_support/callbacks.rb:272:in
run_callbacks' from /home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/gems/gems/rails-2.1.0/lib/initializer.rb:483:in
prepare_dispatcher’
… 7 levels…
from
file:/home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/lib/jruby-rack-0.9.2.jar!/rack/builder.rb:22:in
instance_eval' from file:/home/nolte/tools/jboss-4.2.3.GA/server/default/tmp/deploy/tmp8666342699739510041rails-exp.war/WEB-INF/lib/jruby-rack-0.9.2.jar!/rack/builder.rb:22:in
initialize’
from :3
at
org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:159)
at
org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:53)
at
org.jruby.rack.PoolingRackApplicationFactory.getApplication(PoolingRackApplicationFactory.java:97)
at
org.jruby.rack.DefaultRackDispatcher.process(DefaultRackDispatcher.java:31)
at org.jruby.rack.RackFilter.doFilter(RackFilter.java:51)
The problem here is that controllers/application(.rb) cannot correctly
be loaded, even if the corresponding .rb file exists in the deployment.
“He’s a short-sighted chivalrous hairdresser from the 'hood. She’s a
bloodthirsty blonde wrestler from the wrong side of the tracks. They
fight crime!”
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iEYEARECAAYFAklAMK8ACgkQCNjA0nfhW7xxZACeIjohvnJq+bOI0JdAAXbZRNoX
1JMAoPn/uUN+0e/Z9aa6N0ZTDmdWfhjE
=yPRn
-----END PGP SIGNATURE-----
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email