You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/04/20 07:31:52 UTC

[GitHub] [shardingsphere] BingYu-track opened a new issue #10137: I use sharding-jdbc 5.0.0 It happens"IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required",

BingYu-track opened a new issue #10137:
URL: https://github.com/apache/shardingsphere/issues/10137


   ## Question
   
   It happens"IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required", when I use sharding-jdbc 5.0.0
   env:springboot2.3.5
   version:sharding-jdbc 5.0.0
   The configuration of the datasource is as follows:
   ![image](https://user-images.githubusercontent.com/33021175/115352490-fda78c00-a1e9-11eb-8d76-a27f00e2b862.png)
   
   pom:
   ![image](https://user-images.githubusercontent.com/33021175/115352735-495a3580-a1ea-11eb-9a34-75d85ccec5b1.png)
   
   **The error stack is as follows:**
   `
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userMapper' defined in file [D:\haiku_project\haiku_erp\javaweb-system\target\classes\com\javaweb\system\mapper\UserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1794)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeanByName(AbstractAutowireCapableBeanFactory.java:453)
   	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:527)
   	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:497)
   	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:650)
   	at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:239)
   	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130)
   	at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessProperties(CommonAnnotationBeanPostProcessor.java:318)
   	... 92 common frames omitted
   Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
   	at org.springframework.util.Assert.notNull(Assert.java:201)
   	at org.mybatis.spring.support.SqlSessionDaoSupport.checkDaoConfig(SqlSessionDaoSupport.java:122)
   	at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:73)
   	at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
   	... 105 common frames omitted
   `
   **I've been fixing this problem for two weeks But it dosen't work. It make me freak out, please help me!**


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] BingYu-track commented on issue #10137: I use sharding-jdbc 5.0.0 It happens"IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required",

Posted by GitBox <gi...@apache.org>.
BingYu-track commented on issue #10137:
URL: https://github.com/apache/shardingsphere/issues/10137#issuecomment-824001611


   > you can create a project on github or gitee.
   I finally solved this problem. I’m sorry if I got you all worked up over nothing
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #10137: I use sharding-jdbc 5.0.0 It happens"IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required",

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10137:
URL: https://github.com/apache/shardingsphere/issues/10137#issuecomment-823962555


   you can create a project on github or gitee.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tanchangmin commented on issue #10137: I use sharding-jdbc 5.0.0 It happens"IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required",

Posted by GitBox <gi...@apache.org>.
tanchangmin commented on issue #10137:
URL: https://github.com/apache/shardingsphere/issues/10137#issuecomment-868432750


   replace 
   <artifactId>druid-spring-boot-starter</artifactId>
   with
   <artifactId>druid</artifactId>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] RaigorJiang commented on issue #10137: I use sharding-jdbc 5.0.0 It happens"IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required",

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #10137:
URL: https://github.com/apache/shardingsphere/issues/10137#issuecomment-823145526


   Hi @BingYu-track 
   `sqlSessionFactory ` and `sqlSessionTemplate ` are classes of Mybatis.  I think it's not SS problem.
   Could you provide a demo project on github or gitee, we may help you to find the reason.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] BingYu-track commented on issue #10137: I use sharding-jdbc 5.0.0 It happens"IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required",

Posted by GitBox <gi...@apache.org>.
BingYu-track commented on issue #10137:
URL: https://github.com/apache/shardingsphere/issues/10137#issuecomment-823811036


   > Hi @BingYu-track
   > `sqlSessionFactory ` and `sqlSessionTemplate ` are classes of Mybatis. I think it's not SS problem.
   > Could you provide a demo project on github or gitee, we may help you to find the reason.
   
   of course! How do I send you?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] BingYu-track closed issue #10137: I use sharding-jdbc 5.0.0 It happens"IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required",

Posted by GitBox <gi...@apache.org>.
BingYu-track closed issue #10137:
URL: https://github.com/apache/shardingsphere/issues/10137


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org