title: Read operation exception MongoDB
body: <p>I have both MongoDb and the Spring MVC app running on the same machine. For some reason I get the read operation error when trying to access the data through my Spring MVC app. </p>
  
  <pre><code>Caused by: com.mongodb.MongoException$Network: Read operation to server /192.168.1.79:28017 failed on database utilDb
          at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:253)
          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.DB.getCollectionNames(DB.java:399)
          at com.mongodb.DB.collectionExists(DB.java:441)
          at org.springframework.data.mongodb.core.MongoTemplate$5.doInDB(MongoTemplate.java:438)
          at org.springframework.data.mongodb.core.MongoTemplate$5.doInDB(MongoTemplate.java:436)
          at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:372)
          ... 37 more
  Caused by: java.io.EOFException
          at org.bson.io.Bits.readFully(Bits.java:48)
          at org.bson.io.Bits.readFully(Bits.java:33)
          at org.bson.io.Bits.readFully(Bits.java:28)
          at com.mongodb.Response.&lt;init&gt;(Response.java:40)
          at com.mongodb.DBPort.go(DBPort.java:142)
          at com.mongodb.DBPort.call(DBPort.java:92)
          at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
          ... 45 more
  </code></pre>
  
  <p>Here is the config I have on the app.xml in Spring :</p>
  
  <pre><code>    &lt;!-- Mongo DB Conf --&gt;
  &lt;bean id="mongo" class="org.springframework.data.mongodb.core.MongoFactoryBean"&gt;
      &lt;property name="host" value="192.168.1.79"&gt;&lt;/property&gt;
      &lt;property name="port" value="28017"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate"&gt;
      &lt;constructor-arg name="mongo" ref="mongo"&gt;&lt;/constructor-arg&gt;
      &lt;constructor-arg name="databaseName" value="utilDb"&gt;&lt;/constructor-arg&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Thanks in advance for any inputs.</p>