{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/14601","repository_url":"https://api.github.com/repos/spring-projects/spring-boot","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/14601/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/14601/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/14601/events","html_url":"https://github.com/spring-projects/spring-boot/issues/14601","id":363602515,"node_id":"MDU6SXNzdWUzNjM2MDI1MTU=","number":14601,"title":"Config the attribute [credentials] of mongo client get an IllegalStateException.","user":{"login":"carvinhappy","id":1844835,"node_id":"MDQ6VXNlcjE4NDQ4MzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1844835?v=4","gravatar_id":"","url":"https://api.github.com/users/carvinhappy","html_url":"https://github.com/carvinhappy","followers_url":"https://api.github.com/users/carvinhappy/followers","following_url":"https://api.github.com/users/carvinhappy/following{/other_user}","gists_url":"https://api.github.com/users/carvinhappy/gists{/gist_id}","starred_url":"https://api.github.com/users/carvinhappy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carvinhappy/subscriptions","organizations_url":"https://api.github.com/users/carvinhappy/orgs","repos_url":"https://api.github.com/users/carvinhappy/repos","events_url":"https://api.github.com/users/carvinhappy/events{/privacy}","received_events_url":"https://api.github.com/users/carvinhappy/received_events","type":"User","site_admin":false},"labels":[{"id":825071933,"node_id":"MDU6TGFiZWw4MjUwNzE5MzM=","url":"https://api.github.com/repos/spring-projects/spring-boot/labels/for:%20external-project","name":"for: external-project","color":"c5def5","default":false},{"id":16916894,"node_id":"MDU6TGFiZWwxNjkxNjg5NA==","url":"https://api.github.com/repos/spring-projects/spring-boot/labels/status:%20invalid","name":"status: invalid","color":"fef2c0","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-25T14:18:04Z","updated_at":"2018-09-26T01:27:46Z","closed_at":"2018-09-25T16:25:22Z","author_association":"NONE","body":"Hi, \r\nI get an  IllegalStateException during config the attribute [credentials] of mongo client.\r\n\r\n    Caused by: java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'com.mongodb.MongoCredential' for property 'credentials[0]': no matching editors or conversion strategy found\r\n    \r\n    at org.springframework.beans.TypeConverterDelegate.convertIfNecessary (TypeConverterDelegate.java:299)\r\n\r\n    at org.springframework.beans.TypeConverterDelegate.convertIfNecessary (TypeConverterDelegate.java:135)\r\n    at org.springframework.beans.TypeConverterDelegate.convertToTypedArray \r\n`\r\n\r\nThe version\r\n---\r\nSpring boot version 2.0.5.RELEASE\r\nSpring data mongodb version 2.0.10.RELEASE\r\n\r\nThe configuration \r\n---\r\n\r\n    <mongo:mongo-client id=\"surveyMongo\"\r\n                        credentials=\"${xxx.mongo.username}:${xxx.mongo.password}@${xxx.mongo.database}\"\r\n                        replica-set=\"${xxx.mongo.hostAndPorts}\">\r\n        <mongo:client-options\r\n                connections-per-host=\"${xxx.mongo.connectionsPerHost}\"\r\n                threads-allowed-to-block-for-connection-multiplier=\"${xxx.mongo.threadsAllowedToBlockForConnectionMultiplier}\"\r\n                max-wait-time=\"${xxx.mongo.maxWaitTime}\"\r\n                connect-timeout=\"${xxx.mongo.connectTimeout}\"\r\n                socket-timeout=\"${xxx.mongo.socketTimeout}\"\r\n                socket-keep-alive=\"${xxx.mongo.socketKeepAlive}\"\r\n                write-concern=\"${xxx.mongo.write-concern}\"\r\n                read-preference=\"${xxx.mongo.read-preference}\"\r\n        />\r\n    </mongo:mongo-client>\r\n\r\nI debug it , find the customEditors of class CustomEditorConfigurer  register\r\n\r\n    \"class [Lcom.mongodb.MongoCredential;\" -> \"class org.springframework.data.mongodb.config.MongoCredentialPropertyEditor\"\r\n\r\nbut in the class TypeConverterDelegate, the component type of find the custmEditor is  com.mongodb.MongoCredential . \r\n\r\nI am not sure if this is the reason and what should I do with this problem?"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/424554094","html_url":"https://github.com/spring-projects/spring-boot/issues/14601#issuecomment-424554094","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/14601","id":424554094,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDU1NDA5NA==","user":{"login":"carvinhappy","id":1844835,"node_id":"MDQ6VXNlcjE4NDQ4MzU=","avatar_url":"https://avatars0.githubusercontent.com/u/1844835?v=4","gravatar_id":"","url":"https://api.github.com/users/carvinhappy","html_url":"https://github.com/carvinhappy","followers_url":"https://api.github.com/users/carvinhappy/followers","following_url":"https://api.github.com/users/carvinhappy/following{/other_user}","gists_url":"https://api.github.com/users/carvinhappy/gists{/gist_id}","starred_url":"https://api.github.com/users/carvinhappy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carvinhappy/subscriptions","organizations_url":"https://api.github.com/users/carvinhappy/orgs","repos_url":"https://api.github.com/users/carvinhappy/repos","events_url":"https://api.github.com/users/carvinhappy/events{/privacy}","received_events_url":"https://api.github.com/users/carvinhappy/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T01:27:46Z","updated_at":"2018-09-26T01:27:46Z","author_association":"NONE","body":"Thanks a lot for your reply. \r\nI created a new issues  at the  DATAMONGO JIRA issue,  the url is : [https://jira.spring.io/browse/DATAMONGO-2095](url)"}}
{"actor":{"display_login":"carvinhappy"}}