简体   繁体   English

Rails 3,JRuby和Warbler

[英]Rails 3, JRuby and Warbler

I am trying to deploy a Rails 3 application on Tomcat 6.0.24. 我正在尝试在Tomcat 6.0.24上部署Rails 3应用程序。 The JRuby version is 1.6.2 (ruby-1.8.7-p330) and Warbler is 1.3.0. JRuby版本是1.6.2(ruby-1.8.7-p330),而Warbler是1.3.0。 I use bundler to handle the gem dependencies. 我使用捆绑程序来处理gem依赖项。

Checked the WEB-INF/lib folder and the following jars are present: 检查了WEB-INF / lib文件夹,并且存在以下jar:

  • jruby-rack-1.0.9.jar jruby-rack-1.0.9.jar
  • jruby-core-1.6.2.jar jruby-core-1.6.2.jar
  • jruby-stdlib-1.6.2.jar jruby-stdlib-1.6.2.jar

But, however after the server starts, hitting the application results in the following exception: 但是,但是,在服务器启动之后,点击应用程序将导致以下异常:

javax.servlet.ServletException: Filter execution threw an exception
java.lang.NoClassDefFoundError: Could not initialize class com.kenai.jaffl.struct.Struct$Constants
    com.kenai.jaffl.struct.Struct$Signed64.<init>(Struct.java:1074)
    org.jruby.ext.posix.HeapStruct$Int64.<init>(HeapStruct.java:41)
    org.jruby.ext.posix.LinuxHeapFileStat.<init>(LinuxHeapFileStat.java:35)
    org.jruby.ext.posix.LinuxPOSIX.allocateStat(LinuxPOSIX.java:26)
    org.jruby.ext.posix.LinuxPOSIX.stat(LinuxPOSIX.java:107)
    org.jruby.ext.posix.LazyPOSIX.stat(LazyPOSIX.java:226)
    org.jruby.RubyFileTest.directory_p(RubyFileTest.java:102)
    org.jruby.RubyFileTest.directory_p(RubyFileTest.java:87)
    org.jruby.RubyFileTest$FileTestFileMethods.directory_p(RubyFileTest.java:428)
    org.jruby.RubyFileTest$FileTestFileMethods$s$1$0$directory_p.call(RubyFileTest$FileTestFileMethods$s$1$0$directory_p.gen:65535)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:282)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:139)
    org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    org.jruby.ast.IfNode.interpret(IfNode.java:111)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:147)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:163)
    org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:262)
    org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:105)
    org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:63)
    org.jruby.ast.IfNode.interpret(IfNode.java:117)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
    org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
    org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:120)
    org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:145)
    org.jruby.runtime.callsite.SuperCallSite.cacheAndCall(SuperCallSite.java:286)
    org.jruby.runtime.callsite.SuperCallSite.callBlock(SuperCallSite.java:70)
    org.jruby.runtime.callsite.SuperCallSite.call(SuperCallSite.java:75)
    org.jruby.ast.ZSuperNode.interpret(ZSuperNode.java:101)
    org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104).....

Does that ring any bells? 那会响吗?

[Answer Updated]: The issue was with the java implementation on the server. [更新的答案]:问题出在服务器上的Java实现。 It was Open JDK. 那是Open JDK。 I switched it over to Sun Java 1.6.0_26 and everything started working :) 我将其切换到Sun Java 1.6.0_26,一切都开始工作:)

Not sure if this is a new bug or an old one. 不知道这是新错误还是旧错误。 Consider googling the error or looking on http://bugs.jruby.org . 考虑使用Google搜索错误或查看http://bugs.jruby.org

You might try setting -Djruby.native.enabled=false in the VM to use the pure-Java POSIX layer and avoid this error. 您可以尝试在VM中设置-Djruby.native.enabled=false ,以使用纯Java POSIX层并避免此错误。

The issue was with the java implementation on the server. 问题出在服务器上的Java实现上。 It was Open JDK. 那是Open JDK。 I switched it over to Sun Java 1.6.0_26 and everything started working 我将其切换到Sun Java 1.6.0_26,一切开始正常工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM