How to use mongodb with grails 2.4.4? -
i have been trying use mongodb grails. add following code in plugin part in buildconfig.groovy
compile ":mongodb:3.0.3"
then have changed datasource.groovy follwings:
grails { mongo { host = "localhost" port = 27107 username = "user" password="secretpassword" databasename = "physicians" } }
but causes compilation error followings:
error | 2015-07-14 14:29:53,412 [localhost-startstop-1] error context.grailscontextloaderlistener - error initializing application: error creating bean name 'transactionmanagerpostprocessor': initialization of bean failed; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'transactionmanager': cannot resolve reference bean 'mongotransactionmanager' while setting constructor argument key [1]; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongotransactionmanager': cannot resolve reference bean 'mongodatastore' while setting bean property 'datastore'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongodatastore': cannot resolve reference bean 'mongobean' while setting bean property 'mongo'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongo': invocation of init method failed; nested exception com.mongodb.mongotimeoutexception: timed out while waiting server matches anyserverselector{} after 10000 ms message: error creating bean name 'transactionmanagerpostprocessor': initialization of bean failed; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'transactionmanager': cannot resolve reference bean 'mongotransactionmanager' while setting constructor argument key [1]; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongotransactionmanager': cannot resolve reference bean 'mongodatastore' while setting bean property 'datastore'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongodatastore': cannot resolve reference bean 'mongobean' while setting bean property 'mongo'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongo': invocation of init method failed; nested exception com.mongodb.mongotimeoutexception: timed out while waiting server matches anyserverselector{} after 10000 ms line | method ->> 334 | innerrun in java.util.concurrent.futuretask$sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.futuretask | 1145 | runworker in java.util.concurrent.threadpoolexecutor | 615 | run in java.util.concurrent.threadpoolexecutor$worker ^ 724 | run . . . in java.lang.thread caused beancreationexception: error creating bean name 'transactionmanager': cannot resolve reference bean 'mongotransactionmanager' while setting constructor argument key [1]; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongotransactionmanager': cannot resolve reference bean 'mongodatastore' while setting bean property 'datastore'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongodatastore': cannot resolve reference bean 'mongobean' while setting bean property 'mongo'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongo': invocation of init method failed; nested exception com.mongodb.mongotimeoutexception: timed out while waiting server matches anyserverselector{} after 10000 ms ->> 334 | innerrun in java.util.concurrent.futuretask$sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.futuretask | 1145 | runworker in java.util.concurrent.threadpoolexecutor | 615 | run in java.util.concurrent.threadpoolexecutor$worker ^ 724 | run . . . in java.lang.thread caused beancreationexception: error creating bean name 'mongotransactionmanager': cannot resolve reference bean 'mongodatastore' while setting bean property 'datastore'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongodatastore': cannot resolve reference bean 'mongobean' while setting bean property 'mongo'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongo': invocation of init method failed; nested exception com.mongodb.mongotimeoutexception: timed out while waiting server matches anyserverselector{} after 10000 ms ->> 334 | innerrun in java.util.concurrent.futuretask$sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.futuretask | 1145 | runworker in java.util.concurrent.threadpoolexecutor | 615 | run in java.util.concurrent.threadpoolexecutor$worker ^ 724 | run . . . in java.lang.thread caused beancreationexception: error creating bean name 'mongodatastore': cannot resolve reference bean 'mongobean' while setting bean property 'mongo'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongo': invocation of init method failed; nested exception com.mongodb.mongotimeoutexception: timed out while waiting server matches anyserverselector{} after 10000 ms ->> 334 | innerrun in java.util.concurrent.futuretask$sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.futuretask | 1145 | runworker in java.util.concurrent.threadpoolexecutor | 615 | run in java.util.concurrent.threadpoolexecutor$worker ^ 724 | run . . . in java.lang.thread caused beancreationexception: error creating bean name 'mongo': invocation of init method failed; nested exception com.mongodb.mongotimeoutexception: timed out while waiting server matches anyserverselector{} after 10000 ms ->> 334 | innerrun in java.util.concurrent.futuretask$sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 166 | run in java.util.concurrent.futuretask | 1145 | runworker in java.util.concurrent.threadpoolexecutor | 615 | run in java.util.concurrent.threadpoolexecutor$worker ^ 724 | run . . . in java.lang.thread caused mongotimeoutexception: timed out while waiting server matches anyserverselector{} after 10000 ms ->> 87 | getserver in com.mongodb.basecluster - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 654 | getserver in com.mongodb.dbtcpconnector | 39 | access$300 in '' | 503 | getconnection in com.mongodb.dbtcpconnector$myport | 451 | . . . in '' | 624 | authenticate in com.mongodb.dbtcpconnector | 195 | doauthenticate in com.mongodb.dbapilayer | 765 | authenticatecommandhelper in com.mongodb.db | 721 | authenticate in '' | 149 | afterpropertiesset in org.grails.datastore.gorm.mongo.bean.factory.gmongofactorybean | 334 | innerrun in java.util.concurrent.futuretask$sync | 166 | run in java.util.concurrent.futuretask | 1145 | runworker in java.util.concurrent.threadpoolexecutor | 615 | run in java.util.concurrent.threadpoolexecutor$worker ^ 724 | run . . . in java.lang.thread error | forked grails vm exited error
can please tell me how fix error. btw, tutorial have been following can found in below link : http://blog.mongodb.org/post/18510469058/grails-in-the-land-of-mongodb
your server not reachable, can see in exception trace:
caused mongotimeoutexception: timed out while waiting server matches anyserverselector{} after 10000 ms
Comments
Post a Comment