When loading my rails app from a compiled war, this error occurs (several times) during loading the app:
INFO: An exception happened during JRuby-Rack startup
load error: jopenssl -- java.lang.RuntimeException: (LoadError) no such file to load -- jopenssl/version
In a rails console (java -cp org.jruby.Main -S rails console production) on the server the file loads correctly.
The full error output can be found here: https://gist.github.com/1157043
Any hints greatly appreciated.
Can you set the system property -Djruby.debug.loadService=true in your container/JVM and regenerate the error? I'd be interested to see why it isn't loading. Is Tomcat fully unpacking the war file when it's deployed?
Note: also filed at jruby/jruby-ossl#10
The war file is unpacked fully, judging from file counts. I also randomly checked for files and nothing seems missing.
I put that setting in and found this line:
LoadService: trying resourceFromLoadPath: '/var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/jruby-openssl-0.7.4/lib/jopenssl/version.rb' false false
and verified that that file is in place:
-rw-r--r-- 1 tomcat6 tomcat6 65 2011-08-22 18:30 /var/lib/tomcat6/webapps/ROOT/WEB-INF/gems/gems/jruby-openssl-0.7.4/lib/jopenssl/version.rb
All sorts of other files are found successfully.
Do you have any further idea from this?
PS: I'd have posted the whole log output about loadService, but it's like 60 MB now. I have grep'd for 'jopenssl/version' and that still is 1.2 MB, but I could send you that by mail if you liked.
I've found that gems are not compiled. Could that be a problem? (Since that loader looked for jopenssl/version.class, too)
Not compiled shouldn't be a problem. I'm curious why it couldn't find the the file, that's very odd and worries me. The actual code is here, so for an unknown reason the Java filesystem checks are failing.
Working with @cmw on this, we found that the Tomcat security manager was getting in the way. Closing.
For those people wondering how the issue was resolved, the main thing is to follow the instructions in this post. It's written for TC 5.5 but it should apply to newer versions as well.
If you're skittish about turning off the security manager, then you might try dropping this in the policy.d directory for tomcat (don't recall where it is on the filesystem).