Error: wrong number of arguments (1 for 0)

Hi,

I am working on an application with Jruby and rails. I recently upgraded
Jruby version to 1.4 and rails (Jruby gem) version to 2.3.5.

I randomly get the following error. The error occurs before any of the
application code is called. I am not sure why rails or jruby is passing
some arguments to controller method. The problem only occurs when the
project is deployed in tomcat. It works fine with mongrel.

Any help will be greatly appreciated.

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:50:in
method_missing' /usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:289:inqualified_const_defined?’
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:287:in
each' /usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:287:ininject’
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:287:in
qualified_const_defined?' /usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:413:inload_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:inconstantize’
/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:inconstantize’
/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:inrecognize’
/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:50:inmethod_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:incall’
/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:inserve_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:incall’
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:50:inmethod_missing’
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:289:in
qualified_const_defined?' /usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:287:ineach’
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:287:in
inject' /usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:287:inqualified_const_defined?’
/usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:413:in
load_missing_constant' /usr/share/tomcat6/webapps/ida2/WEB-INF/gems/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:96:inconst_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:ineach’
/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:inconstantize’
/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:incall’
/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:incall’
/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:incache’
/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:incall’
/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:incall’
/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:incall’
/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:incall’
/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:incall’
/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:inrun’
/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:inserve_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:incall’
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”=>""}

Regards,
Jas

After a few print statements in active_support/dependencies.rb class in
‘qualified_const_defined?’ method, I notice that this error occurs after
this method is trying to resolve a Java class named Client with some
package name. Could there be a conflict with resolving the package
Client of the controller Client::AuthController?

-Jas

It certainly could be. Can you file a bug for it and try to reduce it
to a simple case? You may also want to try on JRuby 1.5, where some
class resolution/const_missing issues have been fixed.

On Tue, Mar 2, 2010 at 11:11 AM, Jas G. [email protected]
wrote:


To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks Charles,

I’ll try to reduce the problem. I have filed a bug for it:
http://jira.codehaus.org/browse/JRUBY-4613

I thought the latest version of JRuby was 1.4. Where can I get version
1.5 from?

Regards,
Jas

On Wed, Mar 3, 2010 at 4:15 PM, Jas G. [email protected] wrote:

Thanks Charles,

I’ll try to reduce the problem. I have filed a bug for it:
http://jira.codehaus.org/browse/JRUBY-4613

I thought the latest version of JRuby was 1.4. Where can I get version
1.5 from?

At http://ci.jruby.org/snapshots :slight_smile:

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi,

I was finally able to resolve the problem. It was related to another
issue that I have posted:
http://www.ruby-forum.com/topic/205436#new

Upgrading jruby-rack jar file from 0.9.5 to 0.9.6, resolved the problem.

From what I understand, there is a problem with locking in jruby-rack
jar file, which was causing a deadlock. I was able to get around that by
removing a lock in action-pack gem reloader class (see the above post
for more info).
I didn’t get any deadlocks after that, but it removing the lock caused
problem with loading of the classes.

Thank you for all your help. I really appreciate it.

Regards,
Jas

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs