History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: JRUBY-899
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Thomas E Enebo
Reporter: Dudley Flanders
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
JRuby

NPE in a Rails application with JIT enabled

Created: 28/Apr/07 12:27 PM   Updated: 06/May/07 09:49 PM
Component/s: Compiler
Affects Version/s: None
Fix Version/s: JRuby 1.0.0RC1

Time Tracking:
Not Specified


 Description  « Hide
I'm getting a NullPointerException in my Rails app when I run it under the JIT. Here's the top of the trace:
ActionView::TemplateError (java.lang.NullPointerException: null) on line #51 of app/views/accounts/_accounts.rhtml:
48:         <%- end -%>
49:       <%- end -%>
50:     </tbody>
51:   </table>
52: </div>
    /Users/dudley/Code/JRuby/jruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1023:in `find_one11086421_1751811.__file__'
    /Users/dudley/Code/JRuby/jruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:-1:in `find_one11086421_1751811.run'
    DefaultMethod.java:141:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
    DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'
    DefaultMethod.java:126:in `org.jruby.internal.runtime.methods.DefaultMethod.call'
    EvaluationState.java:1018:in `org.jruby.evaluator.EvaluationState.fCallNode'
    EvaluationState.java:251:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:1229:in `org.jruby.evaluator.EvaluationState.localAsgnNode'
    EvaluationState.java:284:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:521:in `org.jruby.evaluator.EvaluationState.blockNode'
    EvaluationState.java:199:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:644:in `org.jruby.evaluator.EvaluationState.caseNode'
    EvaluationState.java:207:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:521:in `org.jruby.evaluator.EvaluationState.blockNode'
    EvaluationState.java:199:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:162:in `org.jruby.evaluator.EvaluationState.eval'
    DefaultMethod.java:168:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
    DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'
    DefaultMethod.java:126:in `org.jruby.internal.runtime.methods.DefaultMethod.call'
    EvaluationState.java:1018:in `org.jruby.evaluator.EvaluationState.fCallNode'
    EvaluationState.java:251:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:605:in `org.jruby.evaluator.EvaluationState.caseNode'
    EvaluationState.java:207:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:521:in `org.jruby.evaluator.EvaluationState.blockNode'
    EvaluationState.java:199:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:162:in `org.jruby.evaluator.EvaluationState.eval'
    DefaultMethod.java:168:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
    DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'
    DefaultMethod.java:126:in `org.jruby.internal.runtime.methods.DefaultMethod.call'
    AliasMethod.java:70:in `org.jruby.internal.runtime.methods.AliasMethod.call'
    EvaluationState.java:1018:in `org.jruby.evaluator.EvaluationState.fCallNode'
    EvaluationState.java:251:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:521:in `org.jruby.evaluator.EvaluationState.blockNode'
    EvaluationState.java:199:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:162:in `org.jruby.evaluator.EvaluationState.eval'
    DefaultMethod.java:168:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
    DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'
    DefaultMethod.java:126:in `org.jruby.internal.runtime.methods.DefaultMethod.call'
    AliasMethod.java:70:in `org.jruby.internal.runtime.methods.AliasMethod.call'
    EvaluationState.java:563:in `org.jruby.evaluator.EvaluationState.callNode'
    EvaluationState.java:205:in `org.jruby.evaluator.EvaluationState.evalInternal'
    EvaluationState.java:162:in `org.jruby.evaluator.EvaluationState.eval'
    DefaultMethod.java:168:in `org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
    DynamicMethod.java:79:in `org.jruby.internal.runtime.methods.DynamicMethod.call'
    DefaultMethod.java:126:in `org.jruby.internal.runtime.methods.DefaultMethod.call'
    EvaluationState.java:1765:in `org.jruby.evaluator.EvaluationState.vcallNode'

And the relevant method from ActiveRecord::Base (line 1023 is the options.update line):

        def find_one(id, options)
          conditions = " AND (#{sanitize_sql(options[:conditions])})" if options[:conditions]
          options.update :conditions => "#{table_name}.#{connection.quote_column_name(primary_key)} = #{quote_value(id,columns_hash[primary_key])}#{conditions}"

          # Use find_every(options).first since the primary key condition
          # already ensures we have a single record. Using find_initial adds
          # a superfluous :limit => 1.
          if result = find_every(options).first
            result
          else
            raise RecordNotFound, "Couldn't find #{name} with ID=#{id}#{conditions}"
          end
        end


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Thomas E Enebo - 28/Apr/07 06:20 PM
I had the exact same method failing on same line for me with goldberg. That method is working now. Resolving.

Charles Oliver Nutter - 06/May/07 09:49 PM
Closing for 1.0RC1