在Jruby应用程序中加载Java类时出错 [英] Error while loading java Class in Jruby application

查看:118
本文介绍了在Jruby应用程序中加载Java类时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have deployed my Ruby on Rails Application on Torquebox. After starting server I am getting this error

    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

推荐答案

看起来您的Gemfile中有特立尼达宝石.在TorqueBox下不需要该宝石,并且可能无法正确加载.尝试删除特立尼达作为依赖项,看看是否有帮助.如果没有,请在irc(freenode上的#torquebox)或邮件列表"中找到我们,会帮你的.

It looks like you have the trinidad gem in your Gemfile. That gem isn't needed under TorqueBox, and probably won't load properly. Try removing trinidad as a dependency and see if that helps. If not, come see us in irc (#torquebox on freenode) or on the mailing list and we'll give you a hand.

这篇关于在Jruby应用程序中加载Java类时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆