2011-07-12 41 views
1

無論我嘗試解決什麼問題,我都會在應用程序中收到此錯誤。 「無法修改凍結陣列」jRuby錯誤 - 無法修改凍結數組

任何想法這裏可能有什麼錯誤?我在我的本地Ubuntu(10.04)機器上運行Torquebox(1.0.1)上的jRuby(1.6.2)應用程序。下面是一個完整的堆棧跟蹤

HTTP Status 500 - 

type Exception report 

message 

description The server encountered an internal error() that prevented it from fulfilling this request. 

exception 

javax.servlet.ServletException: org.jruby.exceptions.RaiseException: (TypeError) can't modify frozen array 
    org.torquebox.rack.core.servlet.RackFilter.doRack(RackFilter.java:118) 
    org.torquebox.rack.core.servlet.RackFilter.doFilter(RackFilter.java:103) 
    org.torquebox.rack.core.servlet.RackFilter.doFilter(RackFilter.java:75) 

root cause 

org.jruby.exceptions.RaiseException: (TypeError) can't modify frozen array 
    org.jruby.RubyArray.concat(org/jruby/RubyArray.java:1450) 
    #<Class:0x1009c9a44>.Plugin(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/plugin.rb:71) 
    org.jruby.RubyKernel.instance_exec(org/jruby/RubyKernel.java:2045) 
    rubyjit.run_7761DFB9328DE427D0E75A527B886E70C475D69F.run(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:25) 
    #<Class:0x1000dfe45>.run_initializers(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:50) 
    org.jruby.RubyArray.each(org/jruby/RubyArray.java:1602) 
    Rails::Initializable.run_initializers(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/initializable.rb:49) 
    Rails::Application.initialize!(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:134) 
    rubyjit.method_added_79E9152BC344C327B5B6A61AD8A4DB7112D305D2.method_added(classpath:/org/torquebox/rails/core/boot.rb:78) 
    org.jruby.RubyKernel.send(org/jruby/RubyKernel.java:2059) 
    #<Class:0x101305815>.method_missing(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/railties-3.0.7/lib/rails/application.rb:77) 
    #<Class:0x1002cf032>.(root)(vfs:/home/Ruby_Projects/Sample-Torquebox-App/config/environment.rb:5) 
    org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1038) 
    rubyjit.require_48BC09453A4C02A82A5E47520814DA9EA3718525.require(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/polyglot-0.3.1/lib/polyglot.rb:64) 
    rubyjit.require_3E6CA858403268171F46C45451765CD50640768C.require(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239) 
    rubyjit.load_dependency_04443C3CFAC2D53B173F0FF308908A72BD893CCC.load_dependency(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:227) 
    rubyjit.require_3E6CA858403268171F46C45451765CD50640768C.require(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239) 
    #<Class:0x101f38e01>.(root)(vfs:/home/Ruby_Projects/Sample-Torquebox-App/config/environment.rb:6) 
    org.jruby.RubyKernel.instance_eval(org/jruby/RubyKernel.java:2028) 
    Rack::Builder.initialize(/home/torquebox-1.0.1/jruby/lib/ruby/gems/1.8/gems/rack-1.2.3/lib/rack/builder.rb:46) 
    #<Class:0x1002cf032>.(root)(vfs:/home/Ruby_Projects/Sample-Torquebox-App/config.ru:3) 

note The full stack trace of the root cause is available in the JBoss Web/3.0.0-CR1 logs. 
JBoss Web/3.0.0-CR1 
+0

您是否在啓動應用程序或處理請求時得到它? – Martijn

+0

我在啓動應用程序時得到它 – RohanDaxini

回答

3

如果您在啓動過程中出現錯誤,機會是很大的,你實際上是試圖重新定義在初始化凍結陣列(可能是因爲redifining ABBR_DAYNAMES一樣簡單)。如果應用程序可以在MRI下運行,您可以嘗試一下,因爲它會爲您提供詳細的警告。

如果初始化程序中沒有任何內容,那麼它可能是您包含在應用程序中的寶石。嘗試一個一個地拿出寶石,看看結果是什麼。

+0

我從初始化程序(即從config文件夾)中刪除了所有內容,所以它只有一個文件,即environment.rb,我嘗試重新部署應用程序以再次轉動。現在它找不到database.yml,所以我添加了database.yml。重新部署到扭矩再跑,這次我面臨同樣的問題,即「不能修改凍結陣列」。我從gem文件中刪除了所有內容,然後它只有rails 3.0.7和'jdbc-mysql'和'activerecord-jdbc-adapter'....仍然是凍結數組的相同錯誤。扭矩有問題與MySQL? – RohanDaxini

+0

嗯通過JDBC的MySQL應該可以與Torquebox一起使用。我爲你的問題+1了,因爲這似乎是一個奇怪的問題。 – Martijn

+0

我甚至寫了一個Hello World應用並部署到TorqueBox,而helloworld應用工作正常。 – RohanDaxini

相關問題