Forum: JRuby JRoR./JBoss/MySQL issues

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Norman S. (Guest)
on 2009-06-03 22:47
My development environment has changed again. We have gone from
ROR/MySQL to JRoR/Oracle -> JRoR/JBoss/Oracle. Now we have to make it
run under JRoR/JBoss/MySQL. The app runs stand alone JRoR/MySQL with the
JDBC drivers. I am using Warbler to build the War file. I am using JRuby
1.2. Installed Gems are:

*** LOCAL GEMS ***

actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.2.2)
ActiveRecord-JDBC (0.5)
activerecord-jdbc-adapter (0.9)
activerecord-jdbcmysql-adapter (0.9)
activeresource (2.2.2)
activesupport (2.2.2)
jdbc-mysql (5.0.4)
jruby-openssl (0.5)
net-sftp (2.0.2)
net-ssh (2.0.11)
parseexcel (0.5.2)
rails (2.2.2)
rake (0.8.6)
rspec (1.2.0)
rubyzip (0.9.1)
rufus-scheduler (2.0.1)
sources (0.0.1)
tzinfo (0.3.13)
warbler (0.9.12)

I realize that most are not the latest, but they are the combination
that work from db:migrate thru running live so far. I have also
mysql-connector-java-5.0.8-bin.jar in several places, including
jruby\lib.

After deplopying the app, I get the following dump to the browser screen
when I try to access the home page:

MissingSourceFile in UsersController#login
no such file to load -- mysql
RAILS_ROOT:
C:\Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF

Application Trace | Framework Trace | Full Trace
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-complete-1.2.0.jar/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-complete-1.2.0.jar/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:155:in
`require'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activesupport-2.2.2/lib/active_support/core_ext/kernel/requires.rb:7:in
`require_library_or_gem'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activesupport-2.2.2/lib/active_support/core_ext/kernel/reporting.rb:11:in
`silence_warnings'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activesupport-2.2.2/lib/active_support/core_ext/kernel/requires.rb:5:in
`require_library_or_gem'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:63:in
`mysql_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/SubInfo.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:121:in
`retrieve_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:113:in
`connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in
`cache'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in
`perform_action_with_caching'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in
`process'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in
`process_with_filters'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in
`process_with_session_management_support'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in
`process'
:1
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-complete-1.2.0.jar/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-complete-1.2.0.jar/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-complete-1.2.0.jar/monitor.rb:191:in
`mon_synchronize'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in
`handle_request'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in
`dispatch_unlocked'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:123:in
`dispatch'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in
`dispatch'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in
`dispatch_cgi'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in
`dispatch'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/adapter/rails.rb:37:in
`serve_rails'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/adapter/rails.rb:44:in
`call'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:145:in
`call'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/handler/servlet.rb:17:in
`call'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-complete-1.2.0.jar/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-complete-1.2.0.jar/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:155:in
`require'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activesupport-2.2.2/lib/active_support/core_ext/kernel/requires.rb:7:in
`require_library_or_gem'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activesupport-2.2.2/lib/active_support/core_ext/kernel/reporting.rb:11:in
`silence_warnings'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activesupport-2.2.2/lib/active_support/core_ext/kernel/requires.rb:5:in
`require_library_or_gem'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:63:in
`mysql_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in
`new_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
`checkout_new_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in
`checkout'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`loop'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
`checkout'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-complete-1.2.0.jar/monitor.rb:191:in
`mon_synchronize'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in
`checkout'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
`connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in
`retrieve_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:121:in
`retrieve_connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:113:in
`connection'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in
`cache'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in
`perform_action_with_caching'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in
`process'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in
`process_with_filters'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in
`process_with_session_management_support'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in
`process'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in
`handle_request'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in
`dispatch_unlocked'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:123:in
`dispatch'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:122:in
`dispatch'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in
`dispatch_cgi'
C:/Development/jboss-5.0.1.GA/server/default/tmp/as102t/Sub.war/WEB-INF/gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in
`dispatch'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/adapter/rails.rb:37:in
`serve_rails'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/adapter/rails.rb:44:in
`call'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-rack-0.9.3.jar/jruby/rack/rails.rb:145:in
`call'
/C:/Development/jboss-5.0.1.GA/server/default/deploy/Sub.war/WEB-INF/lib/jruby-rack-0.9.3.jar/rack/handler/servlet.rb:17:in
`call'
:1
This error occurred while loading the following files:
   mysql

The mysql-ds.xml in C:\Development\jboss-5.0.1.GA\server\default looks
like this:

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
    <jndi-name>MySqlDS</jndi-name>
    <connection-url>jdbc:mysql://server:3306/sub_development</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>u</user-name>
    <password>p</password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
    <metadata>
       <type-mapping>mySQL</type-mapping>
    </metadata>
  </local-tx-datasource>
</datasources>

I have tried every combination things I can think of. I even
uninstalled/re-installed/switched version of the jdbc gems. I have
checked that Warbler is getting all the gems into the War file.

Any hints/clues/working examples would be GREAT!!!

Thanks,

Norm
Norman S. (Guest)
on 2009-06-04 19:45
I installed Tomcat this AM and get the same error. So, the error is not
directly related to JBoss.

Anyone? Any hints?

Norm
Norman S. (Guest)
on 2009-06-15 17:05
I switched the database to SQLite and I still get the same error both
with JBoss and Tomcat! The app runs just fine from the command line with
any database I throw at it.

Has anyone successfully gotten JRoR using MySQL to build a War file with
Warbler and deploy it successfully to Tomcat or JBoss? I must be doing
something really stupid, but I have been throwing rocks at this for so
long that I can't see what I am doing wrong!!

Norm
This topic is locked and can not be replied to.