开发者

Library `fcntl' can not be loaded on Solaris/Weblogic (JRuby 1.6.1) -> NullPointerException

开发者 https://www.devze.com 2023-03-01 01:26 出处:网络
While trying to deploy a JRuby/Rails Application to a Weblogic 10.3 (Solaris Zone) container it always encounters this exception:

While trying to deploy a JRuby/Rails Application to a Weblogic 10.3 (Solaris Zone) container it always encounters this exception:

org.jruby.rack.RackInitializationException: library `fcntl' could not be loaded: java.lang.NullPointerException
from /xyz/war/WEB-INF/gems/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `require'
from /xyz/war/WEB-INF/gems/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:225:in `load_dependency'
from /xyz/war/WEB-INF/gems/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /xyz/war/WEB-INF/gems/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:225:in `load_dependency'
from /xyz/war/WEB-INF/gems/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `require'
from /xyz/war/WEB-INF/gems/gems/jruby-openssl-0.7.3/lib/openssl/ssl.rb:19:in `(root)'
from org/jruby/RubyKernel.java:1038:in `require'
[..snip...]

It just don't get it why JRuby fails to load this core libr开发者_StackOverflow中文版ary. It seems somehow Solaris related, because installing WLS on MacOS X and deploying locally works without any issues.

Any hints, or pointers where I can look next - or how to solve this issue?

UPDATE: Probably a bug (got feedback in IRC/#jruby now tracked in JRuby JIRA, see: http://jira.codehaus.org/browse/JRUBY-5753


I solved this issue by adding -d32 to JAVA_OPTS, to force the use of a 32-bit JVM.


I was experiencing this problem on Centos 5 and OSX with Tomcat 7 and Jruby 1.7.2. and a sqlite3 db. I resolved the issue through poking around and I'm not sure why what I did solved it but I discovered a few things: I got this error after restarting Tomcat due to a previous crash which left the DB locked. ActiveRecord::StatementInvalid (Java::JavaLang::Error: Internal Error in _syscall(): SELECT "urls".* FROM "urls" ):

The following steps seemed to resolve the issue, though it seems to me that the original error simply indicates that the DB got into a bad state. -I downgraded Jruby to 1.7.1 -I removed all gems pertaining to the db from the gemfile except activerecord-jdbcsqlite3-adapter'. This seemed to resolve this issue. (The gems I removed were 'sqlite-ruby','sqlite3','activerecord-jdbc-adapter', 'jruby-rack') I note that the first gem here was a normal C gem, which shouldn't have been deployed because it wasn in a conditional but seemed to be getting included in the war by warbler anyway. Anyway, I redeployed and it worked, even using the original DB.

0

精彩评论

暂无评论...
验证码 换一张
取 消