首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Jruby应用程序中加载java类时出错

在Jruby应用程序中加载java类时出错
EN

Stack Overflow用户
提问于 2012-07-13 18:46:51
回答 1查看 969关注 0票数 0

我已经在Torquebox上部署了Ruby on Rails应用程序。启动服务器后,我收到此错误

代码语言:javascript
复制
    10:18:06,311 ERROR [org.torquebox.core.runtime] (Thread-95) Error during execution: ENV['RAILS_ROOT']=RACK_ROOT
ENV['RAILS_ENV']=RACK_ENV
require %q(org/torquebox/web/rails/boot)
: org.jruby.exceptions.RaiseException: (NameError) cannot load Java class sun.security.tools.KeyTool
        at org.jruby.javasupport.JavaClass.for_name(org/jruby/javasupport/JavaClass.java:1205) [jruby.jar:]
        at org.jruby.javasupport.JavaUtilities.get_proxy_class(org/jruby/javasupport/JavaUtilities.java:34) [jruby.jar:]
        at Object.java_import(/opt/torquebox/current/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/object.rb:46) at Module.Tomcat(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad_jars-1.0.3/lib/trinidad/jars.rb:20)        at (Anonymous).Trinidad(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad_jars-1.0.3/lib/trinidad/jars.rb:10)        at (Anonymous).(root)(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad_jars-1.0.3/lib/trinidad/jars.rb:5)    at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1033) [jruby.jar:]
        at (Anonymous).(root)(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad_jars-1.0.3/lib/trinidad/jars.rb:10)  at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1033) [jruby.jar:]
        at Runtime.require(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad-1.3.5/lib/trinidad.rb:68)       at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1615) [jruby.jar:]
        at Runtime.require(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66) at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1615) [jruby.jar:]
        at Runtime.require(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55) at (Anonymous).require(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119)     at (Anonymous).(root)(/usr/share/reposiotry/Purple-Hills/config/application.rb:18)      at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1033) [jruby.jar:]
        at (Anonymous).(root)(/usr/share/reposiotry/Purple-Hills/config/application.rb:2)       at org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1058) [jruby.jar:]
        at (Anonymous).(root)(/usr/share/reposiotry/Purple-Hills/config/environment.rb:109)     at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1033) [jruby.jar:]
        at (Anonymous).(root)(file:/opt/torquebox/current/jboss/modules/org/torquebox/web/main/torquebox-web.jar!/org/torquebox/web/rails/boot.rb:3)
10:18:06,362 ERROR [org.torquebox.core.runtime] (Thread-95) Failed to initialize runtime: : org.jruby.exceptions.RaiseException: (NameError) cannot load Java class sun.security.tools.KeyTool
        at org.jruby.javasupport.JavaClass.for_name(org/jruby/javasupport/JavaClass.java:1205) [jruby.jar:]
        at org.jruby.javasupport.JavaUtilities.get_proxy_class(org/jruby/javasupport/JavaUtilities.java:34) [jruby.jar:]
        at Object.java_import(/opt/torquebox/current/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/core_ext/object.rb:46) at Module.Tomcat(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad_jars-1.0.3/lib/trinidad/jars.rb:20)        at (Anonymous).Trinidad(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad_jars-1.0.3/lib/trinidad/jars.rb:10)        at (Anonymous).(root)(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad_jars-1.0.3/lib/trinidad/jars.rb:5)    at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1033) [jruby.jar:]
        at (Anonymous).(root)(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad_jars-1.0.3/lib/trinidad/jars.rb:10)  at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1033) [jruby.jar:]
        at Runtime.require(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/trinidad-1.3.5/lib/trinidad.rb:68)       at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1615) [jruby.jar:]
        at Runtime.require(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:66) at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1615) [jruby.jar:]
        at Runtime.require(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler/runtime.rb:55) at (Anonymous).require(/opt/torquebox/current/jruby/lib/ruby/gems/1.8/gems/bundler-1.1.3/lib/bundler.rb:119)     at (Anonymous).(root)(/usr/share/reposiotry/Purple-Hills/config/application.rb:18)      at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1033) [jruby.jar:]
        at (Anonymous).(root)(/usr/share/reposiotry/Purple-Hills/config/application.rb:2)       at org.jruby.RubyKernel.load(org/jruby/RubyKernel.java:1058) [jruby.jar:]
        at (Anonymous).(root)(/usr/share/reposiotry/Purple-Hills/config/environment.rb:109)     at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1033) [jruby.jar:]
        at (Anonymous).(root)(file:/opt/torquebox/current/jboss/modules/org/torquebox/web/main/torquebox-web.jar!/org/torquebox/web/rails/boot.rb:3)
10:18:06,385 INFO  [org.torquebox.core.runtime] (Thread-95) Created ruby runtime (ruby_version: RUBY1_8, compile_mode: JIT, app: Purple-Hills, context: web) in 29.45s
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-07-14 04:23:38

看起来你的Gemfile里有千里达宝石。该gem在TorqueBox下是不需要的,并且可能不会正确加载。尝试删除作为依赖项的千里达,看看这是否有帮助。如果没有,请在irc (freenode上的#torquebox)或mailing list上来找我们,我们会帮你的。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11468973

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档