2011-06-27 2 views
0

J'essaie de déployer une application Rails 3 sur Tomcat 6.0.24. La version JRuby est 1.6.2 (ruby-1.8.7-p330) et Warbler est 1.3.0. J'utilise bundler pour gérer les dépendances gem.Rails 3, JRuby et Warbler

a vérifié le dossier WEB-INF/lib et les bocaux suivants sont présents:

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

Mais, cependant après que le serveur démarre, les résultats hitting d'application à l'exception suivante:

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

Est-ce que ça sonne des cloches?

[Réponse mise à jour]: Le problème résidait dans l'implémentation Java sur le serveur. C'était Open JDK. Je l'ai passé à Sun Java 1.6.0_26 et tout a commencé à fonctionner :)

Répondre

0

Le problème résidait dans l'implémentation Java sur le serveur. C'était Open JDK. Je l'ai passé à Sun Java 1.6.0_26 et tout a commencé à fonctionner

0

Vous ne savez pas si c'est un nouveau bug ou un ancien. Considérez googler l'erreur ou en regardant http://bugs.jruby.org.

Vous pouvez essayer de définir -Djruby.native.enabled=false dans la machine virtuelle pour utiliser la couche Java pure POSIX et éviter cette erreur.