2010-11-20 2 views
1

Tomcat6에 JRuby on Rails 전쟁을 전개하려고합니다. 어떤 이유로 인해 activerecord-jdbcmysql-adapter를 찾을 수 없습니다. 레일즈 2.3.8, JRuby 1.5.5, JRuby-Rack 1.0.3을 실행 중입니다. 보석은 Bundler를 함께 패키지되어 나는 WEB-INF/보석/보석 디렉토리에서 볼 :Tomcat이 JRuby 전쟁을 통한 jdbcmysql 어댑터를 찾을 수 없습니다.

drwxr-xr-x 3 root root 4096 2010-11-19 20:07 WEB-INF/gems/gems/activerecord-jdbcmysql-adapter-0.9.2 

내가 Tomcat이 보석을 찾을 수 없습니다하는 원인을 몇 가지 환경 변수 또는 뭔가를 놓치고 있습니까? 그것은 보석 목록에 나타나며, 적절한 디렉토리에도 있습니다.

내 database.yml을처럼 보이는 다음

production: 
    adapter: jdbcmysql 
    encoding: utf8 
    database: mydb 
    host: localhost 
    port: 3306 
    username: foo 
    password: somepassword 

역 추적 :

얼마 전에 나는 작은 JRuby를하고 레일 응용 프로그램을 테스트하고 내가 사용 작업 데이터베이스 연결을 가진 적이 없어
Nov 19, 2010 10:02:03 PM org.apache.catalina.core.ApplicationContext log 
SEVERE: unable to create shared application instance 
org.jruby.rack.RackInitializationException: Please install the jdbcmysql adapter: `gem install activerecord-jdbcmysql-adapter` (load error: jdbc_adapter/jdbc_adapter_internal -- java.lang.NoClassDefFoundError: org/jruby/internal/runtime/methods/InvocationMethodFactory$DescriptorInfo) 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:438:in `initialize_database' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:141:in `process' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:113:in `run' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/spree-0.11.1/lib/spree/initializer.rb:90:in `run' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/config/environment.rb:13 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/config/environment.rb:44:in `load' 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:44:in `load_environment' 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:38:in `to_app' 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:186:in `new' 
from <script>:2 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46:in `instance_eval' 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46:in `initialize' 
from <script>:2:in `new' 
from <script>:2 

at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:184) 
at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:59) 
at org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:27) 
at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:40) 
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) 
at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123) 
at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145) 
at java.security.AccessController.doPrivileged(Native Method) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) 
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:902) 
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) 
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) 
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1258) 
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) 
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) 
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) 
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) 
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) 
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) 
at org.apache.catalina.core.StandardService.start(StandardService.java:516) 
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) 
at org.apache.catalina.startup.Catalina.start(Catalina.java:583) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:616) 
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:616) 
at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177) 
Caused by: org.jruby.exceptions.RaiseException: Please install the jdbcmysql adapter: `gem install activerecord-jdbcmysql-adapter` (load error: jdbc_adapter/jdbc_adapter_internal -- java.lang.NoClassDefFoundError: org/jruby/internal/runtime/methods/InvocationMethodFactory$DescriptorInfo) 
at Kernel.raise(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:76) 
at #<Class:01x3b96c67a>.establish_connection(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:60) 
at #<Class:01x3b96c67a>.establish_connection(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:55) 
at #<Class:01x3b96c67a>.establish_connection(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:438) 
at Rails::Initializer.initialize_database(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:141) 
at Rails::Initializer.process(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:113) 
at #<Class:01x77277ffa>.run(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/spree-0.11.1/lib/spree/initializer.rb:90) 
at #<Class:01x251970e2>.run(/var/lib/tomcat6/webapps/fooproj/WEB-INF/config/environment.rb:13) 
at (unknown).(unknown)(/var/lib/tomcat6/webapps/fooproj/WEB-INF/config/environment.rb:44) 
at Kernel.load(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:44) 
at JRuby::Rack::RailsBooter::Rails2Environment.load_environment(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:38) 
at JRuby::Rack::RailsBooter::Rails2Environment.to_app(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:186) 
at #<Class:01x53371566>.new(<script>:2) 
at (unknown).(unknown)(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46) 
at Kernel.instance_eval(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46) 
at Kernel.instance_eval(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46) 
at Rack::Builder.initialize(<script>:2) 
at (unknown).new(<script>:2) 
at (unknown).(unknown)(:1) 
Nov 19, 2010 10:02:03 PM org.apache.catalina.core.ApplicationContext log 
SEVERE: Error: application initialization failed 
org.jruby.rack.RackInitializationException: unable to create shared application instance 
at org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:39) 
at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:40) 
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934) 
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429) 
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) 
at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123) 
at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145) 
at java.security.AccessController.doPrivileged(Native Method) 
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769) 
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) 
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:902) 
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) 
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) 
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1258) 
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) 
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) 
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) 
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) 
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) 
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) 
at org.apache.catalina.core.StandardService.start(StandardService.java:516) 
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) 
at org.apache.catalina.startup.Catalina.start(Catalina.java:583) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:616) 
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:616) 
at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177) 
Caused by: org.jruby.rack.RackInitializationException: Please install the jdbcmysql adapter: `gem install activerecord-jdbcmysql-adapter` (load error: jdbc_adapter/jdbc_adapter_internal -- java.lang.NoClassDefFoundError: org/jruby/internal/runtime/methods/InvocationMethodFactory$DescriptorInfo) 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:438:in `initialize_database' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:141:in `process' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:113:in `run' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/spree-0.11.1/lib/spree/initializer.rb:90:in `run' 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/config/environment.rb:13 
from /var/lib/tomcat6/webapps/fooproj/WEB-INF/config/environment.rb:44:in `load' 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:44:in `load_environment' 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:38:in `to_app' 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:186:in `new' 
from <script>:2 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46:in `instance_eval' 
from file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46:in `initialize' 
from <script>:2:in `new' 
from <script>:2 

at org.jruby.rack.DefaultRackApplicationFactory$4.init(DefaultRackApplicationFactory.java:184) 
at org.jruby.rack.DefaultRackApplicationFactory.getApplication(DefaultRackApplicationFactory.java:59) 
at org.jruby.rack.SharedRackApplicationFactory.init(SharedRackApplicationFactory.java:27) 
... 32 more 
Caused by: org.jruby.exceptions.RaiseException: Please install the jdbcmysql adapter: `gem install activerecord-jdbcmysql-adapter` (load error: jdbc_adapter/jdbc_adapter_internal -- java.lang.NoClassDefFoundError: org/jruby/internal/runtime/methods/InvocationMethodFactory$DescriptorInfo) 
at Kernel.raise(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:76) 
at #<Class:01x3b96c67a>.establish_connection(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:60) 
at #<Class:01x3b96c67a>.establish_connection(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:55) 
at #<Class:01x3b96c67a>.establish_connection(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:438) 
at Rails::Initializer.initialize_database(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:141) 
at Rails::Initializer.process(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/rails-2.3.8/lib/initializer.rb:113) 
at #<Class:01x77277ffa>.run(/var/lib/tomcat6/webapps/fooproj/WEB-INF/gems/gems/spree-0.11.1/lib/spree/initializer.rb:90) 
at #<Class:01x251970e2>.run(/var/lib/tomcat6/webapps/fooproj/WEB-INF/config/environment.rb:13) 
at (unknown).(unknown)(/var/lib/tomcat6/webapps/fooproj/WEB-INF/config/environment.rb:44) 
at Kernel.load(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:44) 
at JRuby::Rack::RailsBooter::Rails2Environment.load_environment(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:38) 
at JRuby::Rack::RailsBooter::Rails2Environment.to_app(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/jruby/rack/rails.rb:186) 
at #<Class:01x53371566>.new(<script>:2) 
at (unknown).(unknown)(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46) 
at Kernel.instance_eval(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46) 
at Kernel.instance_eval(file:/var/lib/tomcat6/webapps/fooproj/WEB-INF/lib/jruby-rack-1.0.3.jar!/vendor/rack-1.2.1/rack/builder.rb:46) 
at Rack::Builder.initialize(<script>:2) 
at (unknown).new(<script>:2) 
at (unknown).(unknown)(:1) 

답변

0

최신 버전의 JRuby, Rails 및 Warbler.

  • JRuby를 1.3.1
  • 레일 2.3.2
  • 솔새 0.9.13
:

많은, 많은 반복 한 후,이 조합은 5.5 톰캣에 근무 WAR 파일을 생성

yourApp/config/warbler.conf 파일의 다음 줄의 주석 처리를 취소하십시오.

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

나는 use MS SQL Server JDBC에 Tomcat을 (를) 게재 할 수있었습니다. MySQL의 경우에는 다르지 않습니다. DB 특정 어댑터를 사용하지는 않지만 일반적인 JDBC 어댑터를 사용하고 실제 JDBC 드라이버를/lib/java 폴더에 제공합니다.

얼간이가 JDBC 드라이버를 패키징하고 있는지 확인하십시오. .war 파일을 검사하여 모든 것이 있는지 확인해야합니다. Bundler를 사용하면 config.gems + =를 지정할 필요가 없습니다. Warbler는 Gemfile.lock의 모든 보석을 가져옵니다.