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 2022/10/10 06:31:30 UTC
[GitHub] [shardingsphere] Mrljt497 opened a new issue, #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Mrljt497 opened a new issue, #21002:
URL: https://github.com/apache/shardingsphere/issues/21002
For English only, other languages will not accept.
Before report a bug, make sure you have:
Searched open and closed [GitHub issues](https://github.com/apache/shardingsphere/issues).
Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will close it.
Please answer these questions before submitting your issue. Thanks!
Which version of ShardingSphere did you use?
5.1.1
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
Normal startup of the project
Actual behavior
Project startup error
Reason analyze (If you can)
Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linruzhou commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
linruzhou commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1250014774
可能是 你配置了多个datasource,但是没指定shardinsphere创建的datasource为Primary
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] pengxianggui commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
pengxianggui commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1364887294
> * I cannot reproduce your problem using ShardingSphere JDBC under pure JDBC 4.1 API. Without any context, I'm inclined to think that this is a compatibility issue of `tk.mybatis:mapper-spring-boot-starter` with your particular Mybatis version.
Unfortunately, I changed tkmapper to mybatisplus, but I got the same result. If I comment out the rules configuration, through breakpoint debugging, it will execute Mybatis related AutoConfiguration, but if I set rules, these AutoConfiguration, Even the DataSourceAutoConfiguration won't assembly.
This is my dependency analysis, for mybatisplus, It couldn't be simpler:

很遗憾,我把tkmapper换成mybatisplus, 但得到的结果是样的。如果我注释掉rules配置,通过断点调试, 程序能顺利执行Mybatis的相关AutoConfiguration, 但如果我设置rules,这些AutoConfiguration,甚至连DataSourceAutoConfiguration都不会装配。
这是我关于mybatisplus的依赖分析,不能更简单了。
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] pengxianggui commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
pengxianggui commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1364628839
I had the same problem. Several of the same issues were found in Issues, but none of them were actually solved, even the ones that were closed. Why mybatis can be assembled successfully if you comment out the configuration of rules? This should not be due to the sequence of automatic assembly.
我有同样的问题。在issue里类似的问题好几个,但是没有一个是真正解决了的,即使是那些关闭了的。为什么注释掉rules的配置,mybatis就能装配成功。这不该是自动装配的先后顺序导致的.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] pengxianggui commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
pengxianggui commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1364776562
> Hi @pengxianggui, can you provide a demo to help reproduce this problem?
Thank you for your attention!
Giving a full demo is a bit of a hassle, and I believe it will be easier to reproduce this problem if you rely on this package:
```
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
</dependency>
```
This is my dependency analysis, for mybatis:

My project is built on springboot 2.2.9
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1248220524
- You didn't give a minimal reproducible example. ShardingSphere configuration doesn't use anything like sqlSessionFactory.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1365691270
@pengxianggui
- I don't seem quite sure what the table structure looks like for the example you're talking about. I'm on my Christmas break, you can open a new question issue.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1364826152
@pengxianggui
- I cannot reproduce your problem using ShardingSphere JDBC under pure JDBC 4.1 API. Without any context, I'm inclined to think that this is a compatibility issue of `tk.mybatis:mapper-spring-boot-starter` with your particular Mybatis version.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] github-actions[bot] closed issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
URL: https://github.com/apache/shardingsphere/issues/21002
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1364639183
Hi @pengxianggui, can you provide a demo to help reproduce this problem?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1407554571
Resolved.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] github-actions[bot] commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1272348415
Hello , this issue has not received a reply for several days.
This issue is supposed to be closed.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] pengxianggui commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
pengxianggui commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1365648804
> @pengxianggui If you don't provide the full stack and unittests, it's a black box. I tested Mybatis Plus earlier and everything works fine.
@linghengqian Thanks for you attention!
I fixed the problem, which was caused by another package I relied on.
By the way, If there are any usage problems, where can we communicate?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] pengxianggui commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
pengxianggui commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1365688792
> > > @pengxianggui If you don't provide the full stack and unittests, it's a black box. I tested Mybatis Plus earlier and everything works fine.
> >
> >
> > @linghengqian Thanks for you attention!
> > I fixed the problem, which was caused by another package I relied on.
> > By the way, If there are any usage problems, where can we communicate?
>
> * For the most part, all communication happens on Github Issues.
All right. I have a question, take the official demo for example.
I used the binding table to avoid the Cartesian product, so I have to use orderId as the sharding field, but in reality, I need to sharding by year, so I should take order_time as the sharding field. Because there are only interval conditions for orderTime in the paging query condition.
How can I avoid Cartesian products in associative table queries while using orderTime sharding?
Thanks for your answer!
好吧。我有一个问题,以官方的demo为例。
我使用了绑定表避免笛卡尔积,因此我必须使用orderId作为分片字段,但是实际情况,我需要按年份分片,我应该取order_time作为分片字段。因为分页查询条件里只有针对orderTime的区间条件。
我如何在使用orderTime分片的同时,又能在关联表查询中避免笛卡尔积呢?
感谢您的解答!
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1365651821
> > @pengxianggui If you don't provide the full stack and unittests, it's a black box. I tested Mybatis Plus earlier and everything works fine.
>
> @linghengqian Thanks for you attention!
> I fixed the problem, which was caused by another package I relied on.
>
> By the way, If there are any usage problems, where can we communicate?
- For the most part, all communication happens on Github Issues.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1365691309
@pengxianggui
- I don't seem quite sure what the table structure looks like for the example you're talking about. I'm on my Christmas break, you can open a new question issue.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] pengxianggui commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
pengxianggui commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1365769095
> * Christmas
well, happy christmas!
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] linghengqian commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
linghengqian commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1364888757
@pengxianggui If you don't provide the full stack and unittests, it's a black box. I tested Mybatis Plus earlier and everything works fine.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] pengxianggui commented on issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by GitBox <gi...@apache.org>.
pengxianggui commented on issue #21002:
URL: https://github.com/apache/shardingsphere/issues/21002#issuecomment-1364829897
> Hi @pengxianggui, can you provide a demo to help reproduce this problem?
Thank you for your attention!
Giving a full demo is a bit of a hassle, and I believe it will be easier to reproduce this problem if you rely on this package:
```
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper-spring-boot-starter</artifactId>
</dependency>
```
This is my dependency analysis, for mybatis:

My project is built on springboot 2.2.9
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang closed issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #21002: Project startup error Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
URL: https://github.com/apache/shardingsphere/issues/21002
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org