{"action":"created","issue":{"url":"https://api.github.com/repos/dianping/camel/issues/2","repository_url":"https://api.github.com/repos/dianping/camel","labels_url":"https://api.github.com/repos/dianping/camel/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/dianping/camel/issues/2/comments","events_url":"https://api.github.com/repos/dianping/camel/issues/2/events","html_url":"https://github.com/dianping/camel/issues/2","id":176285254,"number":2,"title":"如何配置带账号密码的mongodb？","user":{"login":"tuxknight","id":2828183,"avatar_url":"https://avatars.githubusercontent.com/u/2828183?v=3","gravatar_id":"","url":"https://api.github.com/users/tuxknight","html_url":"https://github.com/tuxknight","followers_url":"https://api.github.com/users/tuxknight/followers","following_url":"https://api.github.com/users/tuxknight/following{/other_user}","gists_url":"https://api.github.com/users/tuxknight/gists{/gist_id}","starred_url":"https://api.github.com/users/tuxknight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuxknight/subscriptions","organizations_url":"https://api.github.com/users/tuxknight/orgs","repos_url":"https://api.github.com/users/tuxknight/repos","events_url":"https://api.github.com/users/tuxknight/events{/privacy}","received_events_url":"https://api.github.com/users/tuxknight/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-12T02:59:19Z","updated_at":"2016-09-12T04:22:33Z","closed_at":null,"body":"mongodb.url里只填mongodb的IP:Port才能够正常启动。\r\n\r\n对于配置有数据库账号和密码的mongodb，使用mongodb://user:pass@mongodb:27017 这样的地址配置时，camel启动会抛异常。\r\n建议优化配置方式。\r\n>\r\nCaused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'virtualServerDaoImpl' defined in file [/usr/local/apache-tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/com/dianping/phoenix/lb/dao/impl/VirtualServerDaoImpl.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [com.dianping.phoenix.lb.dao.ModelStore]: : Error creating bean with name 'mongoModelStoreImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTemplateConfig' defined in class path resource [spring/applicationContext-mongo.xml]: Cannot resolve reference to bean 'dbConfig' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbConfig': Cannot resolve reference to bean 'mongo' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongo': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'com.mongodb.ServerAddress[]' for property 'replicaSetSeeds'; nested exception is java.lang.IllegalArgumentException: Could not resolve at least one server of the replica set configuration! Validate your config!; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoModelStoreImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTemplateConfig' defined in class path resource [spring/applicationContext-mongo.xml]: Cannot resolve reference to bean 'dbConfig' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dbConfig': Cannot resolve reference to bean 'mongo' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongo': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'com.mongodb.ServerAddress[]' for property 'replicaSetSeeds'; nested exception is java.lang.IllegalArgumentException: Could not resolve at least one server of the replica set configuration! Validate your config!\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/dianping/camel/issues/comments/246240344","html_url":"https://github.com/dianping/camel/issues/2#issuecomment-246240344","issue_url":"https://api.github.com/repos/dianping/camel/issues/2","id":246240344,"user":{"login":"leonindy","id":6918326,"avatar_url":"https://avatars.githubusercontent.com/u/6918326?v=3","gravatar_id":"","url":"https://api.github.com/users/leonindy","html_url":"https://github.com/leonindy","followers_url":"https://api.github.com/users/leonindy/followers","following_url":"https://api.github.com/users/leonindy/following{/other_user}","gists_url":"https://api.github.com/users/leonindy/gists{/gist_id}","starred_url":"https://api.github.com/users/leonindy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonindy/subscriptions","organizations_url":"https://api.github.com/users/leonindy/orgs","repos_url":"https://api.github.com/users/leonindy/repos","events_url":"https://api.github.com/users/leonindy/events{/privacy}","received_events_url":"https://api.github.com/users/leonindy/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T04:22:33Z","updated_at":"2016-09-12T04:22:33Z","body":"你好，camel使用spring MongoDB驱动连接MongoDB，如果有用户名和密码，请配置spring配置文件：\r\ncamel-admin/src/main/resources/spring/applicationContext-mongo.xml，添加用户名和密码。\r\n\r\n建议把用户名和密码配置在本地文件/data/appdatas/camel/mongo.properties，spring会从中读取配置。\r\n\r\n具体请参考spring官方文档：http://projects.spring.io/spring-data-mongodb/"}}
{"actor":{"display_login":"leonindy"}}