java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Very randomly calls to Spring repository fails from Thread, StackTrace below. Attached Java Classes {noformat} Exception in thread "Thread-2" java.lang.IllegalStateException: open at org.bson.util.Assertions.isTrue(Assertions.java:36) at com.mongodb.DBTCPConnector.isMongosConnection(DBTCPConnector.java:377) at com.mongodb.Mongo.isMongosConnection(Mongo.java:645) at com.mongodb.DBCollection.findOne(DBCollection.java:866) at com.mongodb.DBCollection.findOne(DBCollection.java:844) at com.mongodb.DBCollection.findOne(DBCollection.java:790) at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:1985) at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:1970) at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1744) at org.springframework.data.mongodb.core.MongoTemplate.doFindOne(MongoTemplate.java:1562) at org.springframework.data.mongodb.core.MongoTemplate.findById(MongoTemplate.java:547) at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.findOne(SimpleMongoRepository.java:100) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:405) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:390) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy18.findOne(Unknown Source) at com.test.SpringApp.executeInternal(SpringApp.java:59) at com.test.SpringApp.access$0(SpringApp.java:56) at com.test.SpringApp$1.run(SpringApp.java:69) at java.lang.Thread.run(Thread.java:745) {noformat} *Update 1* This issue could be related to [JAVA-1311|https://jira.mongodb.org/browse/JAVA-1311]
    via by Sri,
  • Very randomly calls to Spring repository fails from Thread, StackTrace below. Attached Java Classes {noformat} Exception in thread "Thread-2" java.lang.IllegalStateException: open at org.bson.util.Assertions.isTrue(Assertions.java:36) at com.mongodb.DBTCPConnector.isMongosConnection(DBTCPConnector.java:377) at com.mongodb.Mongo.isMongosConnection(Mongo.java:645) at com.mongodb.DBCollection.findOne(DBCollection.java:866) at com.mongodb.DBCollection.findOne(DBCollection.java:844) at com.mongodb.DBCollection.findOne(DBCollection.java:790) at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:1985) at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:1970) at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1744) at org.springframework.data.mongodb.core.MongoTemplate.doFindOne(MongoTemplate.java:1562) at org.springframework.data.mongodb.core.MongoTemplate.findById(MongoTemplate.java:547) at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.findOne(SimpleMongoRepository.java:100) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:405) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:390) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy18.findOne(Unknown Source) at com.test.SpringApp.executeInternal(SpringApp.java:59) at com.test.SpringApp.access$0(SpringApp.java:56) at com.test.SpringApp$1.run(SpringApp.java:69) at java.lang.Thread.run(Thread.java:745) {noformat} *Update 1* This issue could be related to [JAVA-1311|https://jira.mongodb.org/browse/JAVA-1311]
    via by Sri,
  • [mongodb-user] db error [not master]
    via by Zsombor,
  • Memory leak in mongo-java-driver v 2.12.0
    via Stack Overflow by aspdeepak
    ,
    • java.lang.IllegalStateException: open at org.bson.util.Assertions.isTrue(Assertions.java:36) at com.mongodb.DBTCPConnector.isMongosConnection(DBTCPConnector.java:377) at com.mongodb.Mongo.isMongosConnection(Mongo.java:645) at com.mongodb.DBCollection.findOne(DBCollection.java:866) at com.mongodb.DBCollection.findOne(DBCollection.java:844) at com.mongodb.DBCollection.findOne(DBCollection.java:790) at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:1985) at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:1970) at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1744) at org.springframework.data.mongodb.core.MongoTemplate.doFindOne(MongoTemplate.java:1562) at org.springframework.data.mongodb.core.MongoTemplate.findById(MongoTemplate.java:547) at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.findOne(SimpleMongoRepository.java:100) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:405) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:390) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:344) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy18.findOne(Unknown Source) at com.test.SpringApp.executeInternal(SpringApp.java:59) at com.test.SpringApp.access$0(SpringApp.java:56) at com.test.SpringApp$1.run(SpringApp.java:69) at java.lang.Thread.run(Thread.java:745)

    Users with the same issue

    linxiaolong
    32 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    2 more bugmates