基于 JBoss 的 Rails 应用程序找不到 activerecord-jdbcmysql-adapter

发布于 2024-09-28 23:20:12 字数 2096 浏览 0 评论 0原文

我有一个 Rails 应用程序部署到 jboss 作为使用 warbler 打包的 war。该应用程序已经运行良好一段时间了。

我希望更改 Rails 应用程序,以便 Rails、所有 Gem 及其依赖项都是供应商提供的。就这个程度而言,我让它工作得很好,可以使用 mongrel 在本地启动应用程序,没有任何问题,也可以毫无问题地构建战争

但是,当我将战争部署到 jboss 时,它无法成功加载应用程序,说它找不到 activerecord- jdbcmysql 适配器。

2010-10-26 14:20:23,281 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/lmd4]] (main) unable to create shared application instance
org.jruby.rack.RackInitializationException: Please install the jdbcmysql adapter: `gem install activerecord-jdbcmysql-adapter` (no such file to load -- active_record/connection_adapters/jdbcmysql_adapter)

这是我到目前为止所做的:

  1. 确保 config/warble.rb 有一个 activerecord-jdbcmysql-adapter 条目

    config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]

  2. 手动解压 war 并确认 gems 存在

WEB-INF/gems/gems

drwxrwxr-x 7 4096 Oct 26 14:14 activerecord-jdbc-adapter-1.0.2-java
drwxrwxr-x 3 4096 Oct 26 14:14 activerecord-jdbcmysql-adapter-1.0.2-java
drwxrwxr-x 3 4096 Oct 26 14:14 bouncy-castle-java-1.5.0145.2
drwxrwxr-x 3 4096 Oct 26 14:14 jdbc-mysql-5.0.4
drwxrwxr-x 4 4096 Oct 26 14:14 jruby-openssl-0.7.1
drwxrwxr-x 7 4096 Oct 26 14:14 rack-1.1.0

WEB-INF /vendor/gems

drwxrwxr-x  7 4096 Oct 26 14:14 activerecord-jdbc-adapter-1.0.2-java
drwxrwxr-x  3 4096 Oct 26 14:14 activerecord-jdbcmysql-adapter-1.0.2-java
drwxrwxr-x  3 4096 Oct 26 14:14 bouncy-castle-java-1.5.0145.2
drwxrwxr-x  5 4096 Oct 26 14:14 fastercsv-1.5.3
drwxrwxr-x 12 4096 Oct 26 14:14 hobo-1.0.1
drwxrwxr-x  7 4096 Oct 26 14:14 hobofields-1.0.1
drwxrwxr-x  4 4096 Oct 26 14:14 hobosupport-1.0.1
drwxrwxr-x  3 4096 Oct 26 14:14 jdbc-mysql-5.0.4
drwxrwxr-x  4 4096 Oct 26 14:14 jruby-openssl-0.7.1
drwxrwxr-x  4 4096 Oct 26 14:14 json-1.4.6-java
drwxrwxr-x  2 4096 Oct 26 14:14 json-jruby-1.4.6-java
drwxrwxr-x  7 4096 Oct 26 14:14 rack-1.1.0
drwxrwxr-x  4 4096 Oct 26 14:14 will_paginate-2.3.15

我不知道是什么原因造成的,但如果有人有任何想法请分享?

JBoss 5 轨道 2.3.10 JRuby 1.5

谢谢

I have a rails application deployed to jboss as a war packaged using warbler. The application has been working great for a while now.

I am looking to change the rails application so that rails, all gems and their dependencies are vendor'd. To that extent I have it working great and can boot the application locally using mongrel with no issues, and can also build the war with no issues

However when I deploy the war to jboss it fails to load the application successfully saying it cant find activerecord-jdbcmysql-adapter.

2010-10-26 14:20:23,281 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/lmd4]] (main) unable to create shared application instance
org.jruby.rack.RackInitializationException: Please install the jdbcmysql adapter: `gem install activerecord-jdbcmysql-adapter` (no such file to load -- active_record/connection_adapters/jdbcmysql_adapter)

This is what i have done so far:

  1. Make sure config/warble.rb has an entry for activerecord-jdbcmysql-adapter

    config.gems += ["activerecord-jdbcmysql-adapter", "jruby-openssl"]

  2. Manually unpacked the war and confirmed the gems are present

WEB-INF/gems/gems

drwxrwxr-x 7 4096 Oct 26 14:14 activerecord-jdbc-adapter-1.0.2-java
drwxrwxr-x 3 4096 Oct 26 14:14 activerecord-jdbcmysql-adapter-1.0.2-java
drwxrwxr-x 3 4096 Oct 26 14:14 bouncy-castle-java-1.5.0145.2
drwxrwxr-x 3 4096 Oct 26 14:14 jdbc-mysql-5.0.4
drwxrwxr-x 4 4096 Oct 26 14:14 jruby-openssl-0.7.1
drwxrwxr-x 7 4096 Oct 26 14:14 rack-1.1.0

WEB-INF/vendor/gems

drwxrwxr-x  7 4096 Oct 26 14:14 activerecord-jdbc-adapter-1.0.2-java
drwxrwxr-x  3 4096 Oct 26 14:14 activerecord-jdbcmysql-adapter-1.0.2-java
drwxrwxr-x  3 4096 Oct 26 14:14 bouncy-castle-java-1.5.0145.2
drwxrwxr-x  5 4096 Oct 26 14:14 fastercsv-1.5.3
drwxrwxr-x 12 4096 Oct 26 14:14 hobo-1.0.1
drwxrwxr-x  7 4096 Oct 26 14:14 hobofields-1.0.1
drwxrwxr-x  4 4096 Oct 26 14:14 hobosupport-1.0.1
drwxrwxr-x  3 4096 Oct 26 14:14 jdbc-mysql-5.0.4
drwxrwxr-x  4 4096 Oct 26 14:14 jruby-openssl-0.7.1
drwxrwxr-x  4 4096 Oct 26 14:14 json-1.4.6-java
drwxrwxr-x  2 4096 Oct 26 14:14 json-jruby-1.4.6-java
drwxrwxr-x  7 4096 Oct 26 14:14 rack-1.1.0
drwxrwxr-x  4 4096 Oct 26 14:14 will_paginate-2.3.15

I dunno what could be causing this but if anyone has any ideas please share?

JBoss 5
Rails 2.3.10
JRuby 1.5

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄与心 2024-10-05 23:20:12

可能是 JBoss/JRuby-Rack 交互问题。过去我们收到过一些报告,称由于 JBoss 在类、资源路径和 URL 中使用了 VFS,因此该功能无法正常工作。你也可能会被这个绊倒。

您可以在 Tomcat 6 中尝试使用相同的 war 文件来将 JBoss 隔离为等式的一部分吗?然后请在 http://kenai.com/jira/browse/JRUBY_RACK 或 < a href="http://bugs.jruby.org/" rel="nofollow">http://bugs.jruby.org/。

Could be a JBoss/JRuby-Rack interaction issue. We've had some reports in the past of this not working due to JBoss' use of VFS in class and resource paths and URLs. You could be tripping on this as well.

Can you try the same war file in Tomcat 6 to isolate JBoss as part of the equation? Then please post a bug at http://kenai.com/jira/browse/JRUBY_RACK or http://bugs.jruby.org/.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文