java - 'webSecurityConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.Unsat -
i looking convert spring boot + spring security + h2 https://github.com/szerhusenbc/jwt-spring-security-demo mongodb. did following changes see issue. please guide how can fixed ?
please let me know how can fixed issue ? dont have idea left implement ?
caused by: org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'websecurityconfig': unsatisfied dependency expressed through field 'userdetailsservice'; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'jwtuserdetailsserviceimpl': unsatisfied dependency expressed through field 'userrepository'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'userrepository': cannot resolve reference bean 'mongotemplate' while setting bean property 'mongooperations'; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'mongotemplate' defined in class path resource [org/springframework/boot/autoconfigure/data/mongo/mongodataautoconfiguration.class]: unsatisfied dependency expressed through method 'mongotemplate' parameter 0; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'mongodbfactory' defined in class path resource [org/springframework/boot/autoconfigure/data/mongo/mongodataautoconfiguration.class]: unsatisfied dependency expressed through method 'mongodbfactory' parameter 0; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongo' defined in class path resource [org/springframework/boot/autoconfigure/mongo/mongoautoconfiguration.class]: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [com.mongodb.mongoclient]: factory method 'mongo' threw exception; nested exception java.lang.illegalstateexception: invalid mongo configuration, either uri or host/port/credentials must specified @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject(autowiredannotationbeanpostprocessor.java:588) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.annotation.injectionmetadata.inject(injectionmetadata.java:88) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotationbeanpostprocessor.java:366) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1264) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:553) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:483) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:302) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:197) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.constructorresolver.instantiateusingfactorymethod(constructorresolver.java:372) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.instantiateusingfactorymethod(abstractautowirecapablebeanfactory.java:1173) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfactory.java:1067) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:513) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:483) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:302) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:202) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.boot.web.servlet.servletcontextinitializerbeans.getorderedbeansoftype(servletcontextinitializerbeans.java:234) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.springframework.boot.web.servlet.servletcontextinitializerbeans.addasregistrationbean(servletcontextinitializerbeans.java:182) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.springframework.boot.web.servlet.servletcontextinitializerbeans.addasregistrationbean(servletcontextinitializerbeans.java:177) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.springframework.boot.web.servlet.servletcontextinitializerbeans.addadaptablebeans(servletcontextinitializerbeans.java:159) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.springframework.boot.web.servlet.servletcontextinitializerbeans.<init>(servletcontextinitializerbeans.java:80) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.getservletcontextinitializerbeans(embeddedwebapplicationcontext.java:241) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.selfinitialize(embeddedwebapplicationcontext.java:228) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext.access$000(embeddedwebapplicationcontext.java:89) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.springframework.boot.context.embedded.embeddedwebapplicationcontext$1.onstartup(embeddedwebapplicationcontext.java:213) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.springframework.boot.context.embedded.tomcat.tomcatstarter.onstartup(tomcatstarter.java:55) ~[spring-boot-1.5.4.release.jar:1.5.4.release] @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5196) ~[tomcat-embed-core-8.5.15.jar:8.5.15] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) ~[tomcat-embed-core-8.5.15.jar:8.5.15] @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1419) ~[tomcat-embed-core-8.5.15.jar:8.5.15] @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1409) ~[tomcat-embed-core-8.5.15.jar:8.5.15] @ java.util.concurrent.futuretask.run(unknown source) ~[na:1.8.0_144] @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) ~[na:1.8.0_144] @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) ~[na:1.8.0_144] @ java.lang.thread.run(unknown source) ~[na:1.8.0_144] caused by: org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'jwtuserdetailsserviceimpl': unsatisfied dependency expressed through field 'userrepository'; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'userrepository': cannot resolve reference bean 'mongotemplate' while setting bean property 'mongooperations'; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'mongotemplate' defined in class path resource [org/springframework/boot/autoconfigure/data/mongo/mongodataautoconfiguration.class]: unsatisfied dependency expressed through method 'mongotemplate' parameter 0; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'mongodbfactory' defined in class path resource [org/springframework/boot/autoconfigure/data/mongo/mongodataautoconfiguration.class]: unsatisfied dependency expressed through method 'mongodbfactory' parameter 0; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongo' defined in class path resource [org/springframework/boot/autoconfigure/mongo/mongoautoconfiguration.class]: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [com.mongodb.mongoclient]: factory method 'mongo' threw exception; nested exception java.lang.illegalstateexception: invalid mongo configuration, either uri or host/port/credentials must specified @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject(autowiredannotationbeanpostprocessor.java:588) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.annotation.injectionmetadata.inject(injectionmetadata.java:88) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor.postprocesspropertyvalues(autowiredannotationbeanpostprocessor.java:366) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1264) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:553) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:483) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:302) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:202) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.config.dependencydescriptor.resolvecandidate(dependencydescriptor.java:208) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.defaultlistablebeanfactory.doresolvedependency(defaultlistablebeanfactory.java:1138) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.defaultlistablebeanfactory.resolvedependency(defaultlistablebeanfactory.java:1066) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject(autowiredannotationbeanpostprocessor.java:585) ~[spring-beans-4.3.9.release.jar:4.3.9.release] ... 36 common frames omitted caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'userrepository': cannot resolve reference bean 'mongotemplate' while setting bean property 'mongooperations'; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'mongotemplate' defined in class path resource [org/springframework/boot/autoconfigure/data/mongo/mongodataautoconfiguration.class]: unsatisfied dependency expressed through method 'mongotemplate' parameter 0; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'mongodbfactory' defined in class path resource [org/springframework/boot/autoconfigure/data/mongo/mongodataautoconfiguration.class]: unsatisfied dependency expressed through method 'mongodbfactory' parameter 0; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'mongo' defined in class path resource [org/springframework/boot/autoconfigure/mongo/mongoautoconfiguration.class]: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [com.mongodb.mongoclient]: factory method 'mongo' threw exception; nested exception java.lang.illegalstateexception: invalid mongo configuration, either uri or host/port/credentials must specified @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvereference(beandefinitionvalueresolver.java:359) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:108) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applypropertyvalues(abstractautowirecapablebeanfactory.java:1531) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1276) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:553) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:483) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:302) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:202) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.config.dependencydescriptor.resolvecandidate(dependencydescriptor.java:208) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.defaultlistablebeanfactory.doresolvedependency(defaultlistablebeanfactory.java:1138) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.support.defaultlistablebeanfactory.resolvedependency(defaultlistablebeanfactory.java:1066) ~[spring-beans-4.3.9.release.jar:4.3.9.release] @ org.springframework.beans.factory.annotation.autowiredannotationbeanpostprocessor$autowiredfieldelement.inject(autowiredannotationbeanpostprocessor.java:585) ~[spring-beans-4.3.9.release.jar:4.3.9.release] ... 49 common frames omitted
user.java
@document public class user { @id private long id; @field private string username; @field private string password; @field private string firstname; @field private string lastname; @field private string email; @field private boolean enabled; @field private date lastpasswordresetdate; @field private list<authority> authorities;
authority.java
@document @xmlrootelement(name="authority") public class authority { @id private long id; @field private authorityname name; @field private list<user> users; #### spring: data: mongodb: port: 27017 uri: mongodb://localhost/test jackson: serialization: indent_output: true
Comments
Post a Comment