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:
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:
--
---
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.
--
---
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.