Error 
------

                 Key: JRUBY-4613
                 URL: http://jira.codehaus.org/browse/JRUBY-4613
             Project: JRuby
          Issue Type: Bug
          Components: Application Error
    Affects Versions: JRuby 1.4, JRuby 1.1.6
         Environment: JRuby 1.4, Java 6, JRuby rails gem 2.3.5, Tomcat 6
            Reporter: Jaspreet Grewal


We recently upgraded jruby and rails version in our application. 
Our current development enviroment includes Jruby 1.4, rails gem 2.3.5, java 6 
and tomcat 6.

We are getting following error in one of the controllers (see ERROR below). The 
problem only occurs in Tomcat, mongrel
on development enviroment works fine.
Also the error starts occuring only after certain other controller methods have 
been called. It seems loading of a
java class with similar name is causing the problem.

Putting some print statements shows that before getting the error 
method 'qualified_const_defined?'  in class 
activesupport-2.3.5/lib/active_support/dependencies.rb 
is called with path parameter being a java class:
path = Java::MyCustomModule::Client

And then method `method_missing' in 
jruby-stdlib-1.4.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb
 
is called with following parameters:
sym = const_get  and args = Client

The name of the controller where the problem occurs is Client::AuthController.

I do have other cases where controller module names is the same as java classes 
and they work fine. 
For example there is a  controller named Admin::AuthController and a java class 
named Java::MyCustomModule::Admin.

More details of the software version numbers is also provided below the error.


====================================================================================================
ERROR
====================================================================================================

ArgumentError in Client/authController#login

wrong number of arguments (1 for 0)

RAILS_ROOT: /var/lib/tomcat6/webapps/ida2/WEB-INF
Application Trace | Framework Trace | Full Trace

file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-stdlib-1.4.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51:in
 `method_missing'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:291:in
 `qualified_const_defined?'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:288:in
 `each'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:288:in
 `inject'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:288:in
 `qualified_const_defined?'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:415:in
 `load_missing_constant'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:96:in
 `const_missing'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in
 `constantize'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `each'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `constantize'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in
 `constantize'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:443:in
 `recognize'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in
 `call'

file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-stdlib-1.4.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51:in
 `method_missing'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in
 `dispatch'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in
 `_call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in
 `build_middleware_stack'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in
 `call'
file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:35:in
 `serve_rails'
file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:51:in
 `call'
file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/rails.rb:148:in
 `call'
file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/handler/servlet.rb:18:in
 `call'

file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-stdlib-1.4.0.jar!/META-INF/jruby.home/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51:in
 `method_missing'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:291:in
 `qualified_const_defined?'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:288:in
 `each'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:288:in
 `inject'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:288:in
 `qualified_const_defined?'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:415:in
 `load_missing_constant'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:96:in
 `const_missing'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:361:in
 `constantize'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `each'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/inflector.rb:360:in
 `constantize'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/core_ext/string/inflections.rb:162:in
 `constantize'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:443:in
 `recognize'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:436:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in
 `dispatch'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in
 `_call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in
 `build_middleware_stack'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:29:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in
 `cache'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:9:in
 `cache'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:28:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/string_coercion.rb:25:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/rack-1.0.1/lib/rack/head.rb:9:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/params_parser.rb:15:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/session/cookie_store.rb:93:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:26:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/rack-1.0.1/lib/rack/lock.rb:11:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:114:in
 `call'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in
 `run'
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in
 `call'
file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:35:in
 `serve_rails'
file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/adapter/rails.rb:51:in
 `call'
file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/jruby/rack/rails.rb:148:in
 `call'
file:/var/lib/tomcat6/webapps/ida2/WEB-INF/lib/jruby-rack-0.9.5.jar!/rack/handler/servlet.rb:18:in
 `call'
:1

Request

Parameters:

{"language"=>"en",
 "brand"=>"ida"}

Show session dump

--- 

Response

Headers:

{"Cache-Control"=>"no-cache",
 "Content-Type"=>""}
 
====================================================================================================



====================================================================================================
More details of development environment:
====================================================================================================
# jruby -v
jruby 1.4.0 (ruby 1.8.7 patchlevel 174) (2009-11-02 69fbfa3) (OpenJDK 64-Bit 
Server VM 1.6.0_0) [amd64-java]

# java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.4.1) (fedora-20.b14.fc11-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b08, mixed mode)

# jruby -S gem list

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-jdbc-adapter (0.9.3)
activeresource (2.3.5)
activesupport (2.3.5)
builder (2.1.2)
color (1.4.1)
fastercsv (1.5.1)
gemcutter (0.4.1)
hoe (2.5.0)
jruby-jars (1.4.0)
jruby-openssl (0.6)
json_pure (1.2.1)
pdf-writer (1.1.8)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rspec (1.2.9)
rubyforge (2.0.3)
sources (0.0.1)
transaction-simple (1.4.0)
warbler (0.9.14)
xml-simple (1.0.12)

====================================================================================================


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to