Skip to content


Subversion checkout URL

You can clone with
Download ZIP


undefined method `render_partial_with_logging' for class `#<Class:0x617ead84>' org/jruby/ `alias_method' #214

atambo opened this Issue · 15 comments

7 participants


I'm getting:

undefined method `render_partial_with_logging' for class `#<Class:0x617ead84>'  org/jruby/ `alias_method'

The backtrace:

Running jruby 1.6.7 with rails 3.2.2 and kaminari 0.13.0


The #to_s method on Paginator aliases a method and then undefs the method it aliased which is not threadsafe. I am hitting the above exception when running kaminari in a threaded environment (jruby on rails application with config.threadsafe! uncommented in environment/production.rb). So one pagination request can come in and undef the render_partial_with_logging method while another request is about to alias the render_partial_with_logging method and then explode with the exception in the gist above.


I keep getting this exception as well. Running jruby 1.6.7 with Rails 3.0.9 in multi threaded mode.


@jhund, I ended up switching to as that is threadsafe and has basically the same api.


Thanks @atambo, will give that a try.


Is this still an issue? Thinking about using it in rails 3.2 + jruby 1.6.7


Yes this is still an issue. I suggest using in a multi-threaded environment.


Hmm. To bad. Any thought about this patch ?

see #164


same problem here. rails 3.2.8 + jruby 1.6.8 + multithread. related #164


Is there any problem to leave the render_partial_with_logging method on the subscriber, making it no more temporary?

Something like this:

      def to_s #:nodoc:
        subscriber = ActionView::LogSubscriber.log_subscribers.detect {|ls| ls.is_a? ActionView::LogSubscriber}
        return super @window_options.merge(@options).merge :paginator => self unless subscriber

        # dirty hack to suppress logging render_partial
        class << subscriber
          alias_method :render_partial_with_logging, :render_partial unless defined?(:render_partial_with_logging)
          # do nothing
          def render_partial(event); end

        ret = super @window_options.merge(@options).merge :paginator => self

        class << subscriber
          alias_method :render_partial, :render_partial_with_logging

It stills not being thread safe, and may miss something, but it will not cause any crash.


I believe this issue solved by #374. Thanks!

@yuki24 yuki24 closed this

I'm still having this issue using Rails 3.2.15 and jRuby 1.7.6.

Undefined method render_partial_with_logging for class '#<Class:0x76d7f01>' 
kaminari (0.14.1) lib/kaminari/helpers/paginator.rb:90:in `to_s' 

@fjyaniez can you check this on 0.15.0?


@gregoriokusowski I'll upgrade and try. Any method to force the error to appear?


Since the error happens when running a multi-threaded environment, it's kinda hard to force it.
You can use a tool like Apache Benchmark/etc to make a lot of parallel requests, but we can't assure that it will happen.


Ok I'll just update, do some tests and post here if the error happens again. Thanks!

@RobinDaugherty RobinDaugherty referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.