开发者

JRuby on Rails does not work with Tomcat running as a service on Windows Server 2008

Problem

It seems like running Tomcat as a service doesn't play well with Rails 3 applications that are packaged up using warble. Looking at the log files, it looks like there is either a circular dependency or a dependency that is being dynamically resolved but cannot be found, so it loops. Eventually, org.jruby.exceptions.RaiseException: stack 开发者_StackOverflow中文版level too deep is thrown. However, when I use startup.bat to start Tomcat instead, this problem does not occur.

Any help would be appreciated! I've been desperately searching for answer to this. Thanks in advance!

Deployment Platform

  • Windows Server 2008 (64-bit)
  • Apache Tomcat 6.29 (64-bit)
  • JDK 1.6
  • Rails 3
  • jruby 1.5.6
  • warbler (1.2.1)
  • jruby-jars (>= 1.4.0)
  • jruby-rack (>= 1.0.0)

Tomcat localhost.log

http://pastie.org/1308566


I would guess your database connection information contains an unexpected null string, which the system is attempting to convert to uppercase somewhere. See this error message as the hint:

at ERB.result(C:/bin/apache-tomcat-6.0.29/webapps/rails3app/WEB-INF/gems/gems/railties-3.0.0/lib/rails/application/configuration.rb:86) at Rails::Application::Configuration.database_configuration(C:/bin/apache-tomcat-6.0.29/webapps/rails3app/WEB-INF/gems/gems/activerecord-3.0.0/lib/active_record/railtie.rb:58)

This may be correctable with a configuration edit.


I just posted the following on your Jruby ticket [http://jira.codehaus.org/browse/JRUBY-5237]:

This is actually a problem with the version of procrun (Apache Commons Daemon) that ships with Tomcat <= 6.0.29. You need to upgrade either the entire Tomcat 6 install or the version of procrun you're using. Procrun needs to be >= 1.0.4

Tomcat 6 upgrade: http://tomcat.apache.org/download-60.cgi

I was having this exact same problem and the upgrade solved it for me.

I've posted over at http://techblog.amphora-research.com/2011/03/tomcat-6-stack-level-too-deep-error-on-windows/ if you're interested in the details.

Good luck!


Look through your startup.bat configuration. It may be that Tomcat is started with a higher memory setting for Java through there, allowing the recursion to finish without running out of memory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜