库“fcntl”无法在 Solaris/Weblogic (JRuby 1.6.1) 上加载 ->空指针异常

发布于 2024-11-03 12:14:59 字数 1221 浏览 7 评论 0原文

在尝试将 JRuby/Rails 应用程序部署到 Weblogic 10.3(Solaris 区域)容器时,它总是会遇到此异常:

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...]

它只是不明白为什么 JRuby 无法加载此核心库。它似乎与 Solaris 有关,因为在 MacOS X 上安装 WLS 并在本地部署没有任何问题。

有什么提示或指示我接下来可以查看 - 或者如何解决这个问题?

更新: 可能是一个错误(在 IRC/#jruby 中获得反馈,现在在 JRuby JIRA 中进行跟踪,请参阅:http:// jira.codehaus.org/browse/JRUBY-5753

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 library. 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我三岁 2024-11-10 12:14:59

我通过将 -d32 添加到 JAVA_OPTS 来解决这个问题,以强制使用 32 位 JVM。

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

时光沙漏 2024-11-10 12:14:59

我在 Centos 5 和 OSX、Tomcat 7 和 Jruby 1.7.2 上遇到了这个问题。和一个 sqlite3 数据库。
我通过四处寻找解决了这个问题,我不确定为什么我所做的解决了这个问题,但我发现了一些事情:
由于之前的崩溃导致数据库被锁定,我在重新启动 Tomcat 后收到此错误。
ActiveRecord::StatementInvalid (Java::JavaLang::Error: Internal Error in _syscall(): SELECT "urls".* FROM "urls" ):

以下步骤似乎解决了该问题,尽管在我看来原始错误只是表明数据库进入了错误状态。
-我将 Jruby 降级到 1.7.1
-我从 gemfile 中删除了与数据库相关的所有 gem,除了 activerecord-jdbcsqlite3-adapter'。这似乎解决了这个问题。 (我删除的 gem 是 'sqlite-ruby'、'sqlite3'、'activerecord-jdbc-adapter'、'jruby-rack')我注意到这里的第一个 gem 是普通的 C gem,不应该部署它因为它是有条件的,但无论如何似乎都被莺卷入了战争。
不管怎样,我重新部署并且它工作了,即使使用原始数据库也是如此。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文