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.

  • I am trying to integrate MongoDB with Apache Spark to process data. When trying to execute my program with this command (../spark-1.3.0-bin-hadoop2.4/bin/spark-submit --master spark://luis-VirtualBox:7077 --jars $(echo /home/luis/mongo-spark/lib/*.jar | tr ' ' ',') --class JavaWordCount target/scala-2.10/mongo-spark_2.10-1.0.jar mydb.testCollection mydb.outputTest7) I get the following exception: 15/03/23 17:05:34 WARN TaskSetManager: Lost task 0.1 in stage 0.0 (TID 4, 10.0.2.15): java.lang.IllegalStateException: open at org.bson.util.Assertions.isTrue(Assertions.java:36) at com.mongodb.DBTCPConnector.getPrimaryPort(DBTCPConnector.java:406) at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:184) at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:167) at com.mongodb.DBCollection.insert(DBCollection.java:161) at com.mongodb.DBCollection.insert(DBCollection.java:107) at com.mongodb.DBCollection.save(DBCollection.java:1049) at com.mongodb.DBCollection.save(DBCollection.java:1014) at com.mongodb.hadoop.output.MongoRecordWriter.write(MongoRecordWriter.java:105) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$12.apply(PairRDDFunctions.scala:1000) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$12.apply(PairRDDFunctions.scala:979) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:61) at org.apache.spark.scheduler.Task.run(Task.scala:64) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:203) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) I have read in some places that it is caused by a close connection, but I don't close it in any part of the code. Thank you in advance.
    via by Luis Rodríguez,
  • I am trying to integrate MongoDB with Apache Spark to process data. When trying to execute my program with this command (../spark-1.3.0-bin-hadoop2.4/bin/spark-submit --master spark://luis-VirtualBox:7077 --jars $(echo /home/luis/mongo-spark/lib/*.jar | tr ' ' ',') --class JavaWordCount target/scala-2.10/mongo-spark_2.10-1.0.jar mydb.testCollection mydb.outputTest7) I get the following exception: 15/03/23 17:05:34 WARN TaskSetManager: Lost task 0.1 in stage 0.0 (TID 4, 10.0.2.15): java.lang.IllegalStateException: open at org.bson.util.Assertions.isTrue(Assertions.java:36) at com.mongodb.DBTCPConnector.getPrimaryPort(DBTCPConnector.java:406) at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:184) at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:167) at com.mongodb.DBCollection.insert(DBCollection.java:161) at com.mongodb.DBCollection.insert(DBCollection.java:107) at com.mongodb.DBCollection.save(DBCollection.java:1049) at com.mongodb.DBCollection.save(DBCollection.java:1014) at com.mongodb.hadoop.output.MongoRecordWriter.write(MongoRecordWriter.java:105) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$12.apply(PairRDDFunctions.scala:1000) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$12.apply(PairRDDFunctions.scala:979) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:61) at org.apache.spark.scheduler.Task.run(Task.scala:64) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:203) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) I have read in some places that it is caused by a close connection, but I don't close it in any part of the code. Thank you in advance.
    via by Luis Rodríguez,
  • RDD is only partially written to mongo
    via by Unknown author,
  • Saw this exception in a log file: {noformat} 2014-07-10 13:58:35,231 [http-apr-8080-exec-4] ERROR MyAppExceptionMapper - Failed to process request java.lang.IllegalStateException: open at org.bson.util.Assertions.isTrue(Assertions.java:36) ~[bson-2.12.2.jar:na] at com.mongodb.DBPort.runCommand(DBPort.java:196) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:647) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBPort.authenticate(DBPort.java:364) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBPort.checkAuth(DBPort.java:375) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBTCPConnector.doOperation(DBTCPConnector.java:209) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:181) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollectionImpl.insertWithWriteProtocol(DBCollectionImpl.java:528) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:193) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:165) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollection.insert(DBCollection.java:161) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollection.insert(DBCollection.java:107) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollection.save(DBCollection.java:966) ~[mongo-java-driver-2.12.2.jar:na] at org.jongo.Insert.save(Insert.java:50) ~[jongo-1.0.jar:na] at org.jongo.MongoCollection.save(MongoCollection.java:128) ~[jongo-1.0.jar:na] at MyAppRepository.save(MyAppRepository.java:43) ~[MyAppRepository.class:na] ... {noformat} This happened while the app was running (had been started almost exactly 20 minutes before), there was no shutdown in progress (regular application logging just continues after this). There was no IOException or similar logged. I did have maxConnectionIdleTime assigned to 120000 ms (2 minutes). This failing request failed on the first mongo query of the webapp request, about 4 seconds after the webapp request came in the IllegalArgumentException was thrown. The webapp request before this one was about 4 minutes earlier, so probably the max connection idle time cleanup logic had run. The application currently relies on catching MongoSocketException for retries, would be nice to receive that exception in this case too, if it was indeed a network-related problem.
    via by Stefan Larsson,
  • Saw this exception in a log file: {noformat} 2014-07-10 13:58:35,231 [http-apr-8080-exec-4] ERROR MyAppExceptionMapper - Failed to process request java.lang.IllegalStateException: open at org.bson.util.Assertions.isTrue(Assertions.java:36) ~[bson-2.12.2.jar:na] at com.mongodb.DBPort.runCommand(DBPort.java:196) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBPort$NativeAuthenticator.authenticate(DBPort.java:647) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBPort.authenticate(DBPort.java:364) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBPort.checkAuth(DBPort.java:375) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBTCPConnector.doOperation(DBTCPConnector.java:209) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:181) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollectionImpl.insertWithWriteProtocol(DBCollectionImpl.java:528) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:193) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:165) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollection.insert(DBCollection.java:161) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollection.insert(DBCollection.java:107) ~[mongo-java-driver-2.12.2.jar:na] at com.mongodb.DBCollection.save(DBCollection.java:966) ~[mongo-java-driver-2.12.2.jar:na] at org.jongo.Insert.save(Insert.java:50) ~[jongo-1.0.jar:na] at org.jongo.MongoCollection.save(MongoCollection.java:128) ~[jongo-1.0.jar:na] at MyAppRepository.save(MyAppRepository.java:43) ~[MyAppRepository.class:na] ... {noformat} This happened while the app was running (had been started almost exactly 20 minutes before), there was no shutdown in progress (regular application logging just continues after this). There was no IOException or similar logged. I did have maxConnectionIdleTime assigned to 120000 ms (2 minutes). This failing request failed on the first mongo query of the webapp request, about 4 seconds after the webapp request came in the IllegalArgumentException was thrown. The webapp request before this one was about 4 minutes earlier, so probably the max connection idle time cleanup logic had run. The application currently relies on catching MongoSocketException for retries, would be nice to receive that exception in this case too, if it was indeed a network-related problem.
    via by Stefan Larsson,
  • java.lang.IllegalStateException: this should be impossible
    via by jm.n...@googlemail.com,
    • java.lang.IllegalStateException: open at org.bson.util.Assertions.isTrue(Assertions.java:36) at com.mongodb.DBTCPConnector.getPrimaryPort(DBTCPConnector.java:406) at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:184) at com.mongodb.DBCollectionImpl.insert(DBCollectionImpl.java:167) at com.mongodb.DBCollection.insert(DBCollection.java:161) at com.mongodb.DBCollection.insert(DBCollection.java:107) at com.mongodb.DBCollection.save(DBCollection.java:1049) at com.mongodb.DBCollection.save(DBCollection.java:1014) at com.mongodb.hadoop.output.MongoRecordWriter.write(MongoRecordWriter.java:105) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$12.apply(PairRDDFunctions.scala:1000) at org.apache.spark.rdd.PairRDDFunctions$$anonfun$12.apply(PairRDDFunctions.scala:979) at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:61) at org.apache.spark.scheduler.Task.run(Task.scala:64) at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:203) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

    Users with the same issue

    pulse00
    22 times, last one,
    linxiaolong
    32 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    3 more bugmates