JRuby

JRuby on Rails raise an exception while connecting to database throw socket

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not A Bug
  • Affects Version/s: JRuby 1.1RC3
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Ubuntu Hardy Heron(Debian lenny/sid)
    Linux ss 2.6.24-12-386 #1 Wed Mar 12 22:30:29 UTC 2008 i686 GNU/Linux
    Rails 1.2.3-6
    mysql Ver 14.12 Distrib 5.0.51a, for debian-linux-gnu (i486) using readline 5.2
  • Number of attachments :
    0

Description

Start petstore from thoughtworks with default configuration:
jruby-1.1RC3/bin/jruby -J-server script/server -e production
Test url with ab:
ab -c 1 -n 1000 http://localhost:3000/shop/viewCategory.shtml?category=DOGS
All requests will raise following exception:
---------------------------------
EMULTIHOP (Reserved)
petstore/trunk/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:389:in `connect'
petstore/trunk/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:152:in `initialize'
petstore/trunk/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `new'
petstore/trunk/vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:82:in `mysql_connection'
petstore/trunk/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:262:in `connection='
petstore/trunk/vendor/rails/activerecord/lib/active_record/query_cache.rb:54:in `connection='
petstore/trunk/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:230:in `retrieve_connection'
petstore/trunk/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in `connection'
petstore/trunk/vendor/rails/activerecord/lib/active_record/base.rb:763:in `columns'
petstore/trunk/vendor/rails/activerecord/lib/active_record/base.rb:771:in `columns_hash'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:105:in `setup_sessid_compatibility!'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:79:in `find_by_session_id'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:283:in `initialize'
petstore/trunk/vendor/rails/activerecord/lib/active_record/base.rb:867:in `silence'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb:283:in `initialize'
jruby-1.1RC3/lib/ruby/1.8/cgi/session.rb:273:in `new'
jruby-1.1RC3/lib/ruby/1.8/cgi/session.rb:273:in `initialize'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:136:in `new'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:136:in `session'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:168:in `stale_session_check!'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/cgi_process.rb:120:in `session'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/base.rb:1058:in `assign_shortcuts'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/flash.rb:140:in `assign_shortcuts_with_flash'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/base.rb:429:in `process'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/filters.rb:684:in `process_with_filters'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in `process_with_session_management_support'
petstore/trunk/vendor/rails/actionpack/lib/action_controller/base.rb:334:in `process'
petstore/trunk/vendor/rails/railties/lib/dispatcher.rb:41:in `dispatch'
petstore/trunk/vendor/rails/railties/lib/webrick_server.rb:113:in `handle_dispatch'
petstore/trunk/vendor/rails/railties/lib/webrick_server.rb:79:in `service'
jruby-1.1RC3/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
jruby-1.1RC3/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
jruby-1.1RC3/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
:1:in `start'

Activity

Hide
Khaled Agrama added a comment -

Running into this too. Anyone know of a workaround?

Show
Khaled Agrama added a comment - Running into this too. Anyone know of a workaround?
Hide
kristian meier added a comment -

I did see the same error, which disappeared when I used jdbcmysql adapter (database.yaml). maybe you have the same misconfiguration.

Show
kristian meier added a comment - I did see the same error, which disappeared when I used jdbcmysql adapter (database.yaml). maybe you have the same misconfiguration.
Hide
Mike McKinney added a comment -

getting same thing... trying to test without the jdbc drivers. as noted, it's minor, but definitely an issue. connecting to mysql with socket defined, works in MRI... hitting via console.

Show
Mike McKinney added a comment - getting same thing... trying to test without the jdbc drivers. as noted, it's minor, but definitely an issue. connecting to mysql with socket defined, works in MRI... hitting via console.
Hide
Ola Bini added a comment -

This is because it tries to use sockets to communicate, which doesn't always work. You need to make sure there is no socket line in the configuration for the database.

Show
Ola Bini added a comment - This is because it tries to use sockets to communicate, which doesn't always work. You need to make sure there is no socket line in the configuration for the database.
Hide
Ola Bini added a comment -

This is a configuration error in the database settings for the app, as noted in my comment above.

Show
Ola Bini added a comment - This is a configuration error in the database settings for the app, as noted in my comment above.

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: