Mongoid JRuby issue - Bignum to Fixnum ClassCastException

26 views
Skip to first unread message

Byron Appelt

unread,
Feb 6, 2017, 9:49:41 AM2/6/17
to Mongoid

I am having trouble with using Mongoid in a Rails app under JRuby. I can insert records and count records, but any attempt to query results in the following:


irb(main):004:0> ConnectionErrorLog.first

D, [2017-01-24T19:08:13.236000 #278] DEBUG -- : MONGODB | Adding mongo:27017 to the cluster.
D, [2017-01-24T19:08:13.341000 #278] DEBUG -- : MONGODB | mongo:27017 | mongoid.find | STARTED | {"find"=>"connection_error_logs", "filter"=>{}, "limit"=>1, "singleBatch"=>true}
D, [2017-01-24T19:08:13.389000 #278] DEBUG -- : MONGODB | mongo:27017 | mongoid.find | SUCCEEDED | 0.004s

Java::JavaLang::ClassCastException: org.jruby.RubyBignum cannot be cast to org.jruby.RubyFixnum

from org.jruby.RubyBasicObject.addFinalizer(RubyBasicObject.java:1217)
from org.jruby.runtime.ObjectSpace.addFinalizer(ObjectSpace.java:118)
from org.jruby.RubyObjectSpace.define_finalizer(RubyObjectSpace.java:83)
from org.jruby.RubyObjectSpace$INVOKER$s$0$1$define_finalizer.call(RubyObjectSpace$INVOKER$s$0$1$define_finalizer.gen)
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:218)
from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:214)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:204)
from org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
from org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
from org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:290)
from org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:243)
from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:376)
from org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:247)
... 291 levels...


I am using the following versions:

  • Rails 4.1.13
  • JRUBY 1.7.23
  • Mongoid Gem 5.1.5
  • Mongo Gem 2.3.1
  • Mongodb server 3.2.11

I am somewhat at a loss as to how to debug this further. I have stripped my model down to the minimum:


class ConnectionErrorLog
  include Mongoid::Document
end


And mongoid.yml:


development_docker:
  clients:
    default:
      database: mongoid
      hosts:
        - mongo:27017


Any help is greatly appreciated. I have posted the same question stack overflow but received no response there: 


http://stackoverflow.com/questions/41837488/bignum-to-fixnum-classcastexception-error-using-mongoid-under-jruby

Durran Jordan

unread,
Feb 6, 2017, 5:44:01 PM2/6/17
to Mongoid
Could you open a Jira ticket for this with the provided information plus your Java version as well? That way we can go through the official support channels and more people can have a look at it. The public project is here: https://jira.mongodb.org/browse/MONGOID

--

---
You received this message because you are subscribed to the Google Groups "Mongoid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoid+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Byron Appelt

unread,
Feb 6, 2017, 7:14:11 PM2/6/17
to mon...@googlegroups.com

--

---
You received this message because you are subscribed to a topic in the Google Groups "Mongoid" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongoid/_Fnhnpiab9M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongoid+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages