Deploying spring app in Tomcat with Mongodb running in Micro cloud foundry -


i getting following exception when trying connect micro cloud foundry mongodb server through spring application running inside localhost tomcat server.

exception: jun 05, 2012 4:30:44 pm com.mongodb.dbtcpconnector fetchmaxbsonobjectsize warning: exception determining maxbson size using0 java.io.ioexception: couldn't connect [/192.168.80.128:27017] bc:java.net.connectexception: connection refused: connect     @ com.mongodb.dbport._open(dbport.java:228)     @ com.mongodb.dbport.go(dbport.java:112)     @ com.mongodb.dbport.go(dbport.java:93)     @ com.mongodb.dbport.findone(dbport.java:146) 

scenario:

spring app configured cloud foundry works in micro cloud foundry set up.
works when deployed live cloudfoundry.com
deployed app in vmware vfabric tomcat inside spring tool suite(sts),
pointing mongodb running in virtual machine ( 192.168.80.128)

root-context.xml: (with change in host configuration)

<beans profile="default"> <mongo:db-factory id="mongodbfactory" dbname="pwdtest" host="192.168.80.128"  port="27017" username="test_user" password="efgh"/> </beans 

this host pinging localhost machine.

please advice needs changed in mongodb setup.

i couldn't find through god site.. mean google..:)

cheers kum

if tomcat application not running on micro cloundfoundry vm not able access mongodb instance via port 27017 thats available via localhost on vm itself.

if application running outside mcf vm need create tunnel instance using vmc , adjust connection in application accordingly. more details on "vmc tunnel" take @ http://docs.cloudfoundry.com/tools/vmc/caldecott.html

cheers

dan


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -