springboot多数据源配置启动一直报这个错啊,请问时怎么回事?
Opened this issue · 5 comments
wccJava commented
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [D:\IDEA\idea2019\springboot\springboot-datasource\target\classes\com\spring\datasource\mapper\UserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
lzyqssn commented
你看看你是不是没有注入sqlSessionFactory 和 sqlSessionTemplate。或者没有写@bean注解。另外还有可能是你注入这两个的时候没有指定名字。发自我的华为手机-------- 原始邮件 --------主题:[yidao620c/SpringBootBucket] springboot多数据源配置启动一直报这个错啊,请问时怎么回事? (#15)发件人:wccJava 收件人:yidao620c/SpringBootBucket 抄送:Subscribed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [D:\IDEA\idea2019\springboot\springboot-datasource\target\classes\com\spring\datasource\mapper\UserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.
lzyqssn commented
提供一下你的代码看看。
…------------------ 原始邮件 ------------------
发件人: "wccJava"<notifications@github.com>;
发送时间: 2019年6月5日(星期三) 晚上8:00
收件人: "yidao620c/SpringBootBucket"<SpringBootBucket@noreply.github.com>;
抄送: "1097842122"<1097842122@qq.com>;"Mention"<mention@noreply.github.com>;
主题: Re: [yidao620c/SpringBootBucket] springboot多数据源配置启动一直报这个错啊,请问时怎么回事? (#15)
@lzyqssn 感谢您的回答!我仔细看了demo发现并没有对这两点进行注入,如果注入,请问如何注入?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.