Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

  1. ,
    via GitHub by rawlingsj

    host port isnt set

  2. ,

    Check if your MongoDB is available.

Solutions on the web

via JIRA by Etienne Morency-Bachand [X], 1 year ago
com.mongodb.MongoException$Network: Read operation to server localhost/127.0.0.1:27017 failed on database data
via JIRA by Etienne Morency-Bachand [X], 2 years ago
com.mongodb.MongoException$Network: Read operation to server localhost/127.0.0.1:27017 failed on database data
java.net.ConnectException: Connection refused	at java.net.PlainSocketImpl.socketConnect(Native Method)	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)	at java.net.Socket.connect(Socket.java:579)	at com.mongodb.DBPort._open(DBPort.java:223)	at com.mongodb.DBPort.go(DBPort.java:125)	at com.mongodb.DBPort.call(DBPort.java:92)	at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)	at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)	at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)	at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)	at com.mongodb.DBCollection.findOne(DBCollection.java:728)	at com.mongodb.DBCollection.findOne(DBCollection.java:670)	at org.obiba.magma.datasource.mongodb.MongoDBValueTable.asDBObject(MongoDBValueTable.java:78)	at org.obiba.magma.datasource.mongodb.MongoDBValueTable.setLastUpdate(MongoDBValueTable.java:96)	at org.obiba.magma.datasource.mongodb.MongoDBValueTableWriter.updateLastUpdate(MongoDBValueTableWriter.java:68)	at org.obiba.magma.datasource.mongodb.MongoDBValueTableWriter.close(MongoDBValueTableWriter.java:64)	at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:165)	at org.obiba.magma.support.DatasourceCopier.copy(DatasourceCopier.java:149)	at org.obiba.opal.core.service.impl.CopyValueTablesLockingAction$CopyAction.execute(CopyValueTablesLockingAction.java:133)	at org.obiba.opal.core.magma.concurrent.LockingActionTemplate$1.doInTransactionWithoutResult(LockingActionTemplate.java:47)	at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)	at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.doInTransaction(LockingActionTemplate.java:42)	at org.obiba.opal.core.magma.concurrent.LockingActionTemplate.execute(LockingActionTemplate.java:31)	at org.obiba.opal.core.service.impl.DefaultImportService.copyValueTables(DefaultImportService.java:336)	at org.obiba.opal.core.service.impl.DefaultImportService.importData(DefaultImportService.java:167)	at org.obiba.opal.core.service.impl.DefaultImportService.importData(DefaultImportService.java:152)	at org.obiba.opal.shell.commands.ImportCommand.importFromTables(ImportCommand.java:224)	at org.obiba.opal.shell.commands.ImportCommand.executeImports(ImportCommand.java:94)	at org.obiba.opal.shell.commands.ImportCommand.execute(ImportCommand.java:73)	at org.obiba.opal.shell.CommandJob.run(CommandJob.java:132)	at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)	at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)	at java.util.concurrent.FutureTask.run(FutureTask.java:166)	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:724)