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/11/26 07:56:28 UTC
[GitHub] [shardingsphere] ZWMdarker opened a new issue #13817: Configuration: sharding-algorithms.xxx.props.algorithm-expression init failure in 5.0.0
ZWMdarker opened a new issue #13817:
URL: https://github.com/apache/shardingsphere/issues/13817
Configuration is as follows:
spring:
shardingsphere:
.......
rules:
sharding:
binding-tables: t_file
tables:
t_file:
database-strategy:
standard:
sharding-column: c_wjdx
sharding-algorithm-name: database_inline
table-strategy:
standard:
sharding-column: c_bh
sharding-algorithm-name: table_inline
sharding-algorithms:
database_inline:
type: INLINE
props:
algorithm-expression: ds$->{c_wjdx % 2}
table_inline:
type: INLINE
props:
algorithm-expression: t_file$->{c_bh % 3}
When I started the project, it always gave me this error: java.lang.NullPointerException: Inline sharding algorithm expression cannot be null.
But I've configured this property
--
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] ZWMdarker commented on issue #13817: Configuration: sharding-algorithms.xxx.props.algorithm-expression init failure in 5.0.0
Posted by GitBox <gi...@apache.org>.
ZWMdarker commented on issue #13817:
URL: https://github.com/apache/shardingsphere/issues/13817#issuecomment-979938079
@zjcnb thx, When I modified this parameter(<sharding-algorithm-name>), the problem was solved. but, I got the above configuration from the official website
from : https://shardingsphere.apache.org/document/5.0.0/en/user-manual/shardingsphere-jdbc/usage/sharding/spring-boot-starter/
Real is too embarrassing~~~
--
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] ZWMdarker commented on issue #13817: Configuration: sharding-algorithms.xxx.props.algorithm-expression init failure in 5.0.0
Posted by GitBox <gi...@apache.org>.
ZWMdarker commented on issue #13817:
URL: https://github.com/apache/shardingsphere/issues/13817#issuecomment-979766374
and I debugged the source code, I found in the class AbstractAlgorithmProvidedBeanRegistry ,this method registerBean.
boolean existProps = PropertyUtil.containPropertyPrefix(environment, propsPrefix) always return false; and i try to use this method environment.getProperty("spring.shardingsphere.rules.sharding.sharding-algorithms.database_inline.props.algorithm-expression") , i can get the result
--
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] terrymanu commented on issue #13817: Configuration: sharding-algorithms.xxx.props.algorithm-expression init failure in 5.0.0
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #13817:
URL: https://github.com/apache/shardingsphere/issues/13817#issuecomment-991855183
Fixed
--
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] zjcnb commented on issue #13817: Configuration: sharding-algorithms.xxx.props.algorithm-expression init failure in 5.0.0
Posted by GitBox <gi...@apache.org>.
zjcnb commented on issue #13817:
URL: https://github.com/apache/shardingsphere/issues/13817#issuecomment-980542263
I think you can fixed it. Welcome to join ShardingSphere!
--
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] zjcnb commented on issue #13817: Configuration: sharding-algorithms.xxx.props.algorithm-expression init failure in 5.0.0
Posted by GitBox <gi...@apache.org>.
zjcnb commented on issue #13817:
URL: https://github.com/apache/shardingsphere/issues/13817#issuecomment-979827584
refer to: #13554
@ZWMdarker Hi, you can change `database_inline` to `database-inline` and `table_inline `to `table-inline`
--
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] terrymanu closed issue #13817: Configuration: sharding-algorithms.xxx.props.algorithm-expression init failure in 5.0.0
Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #13817:
URL: https://github.com/apache/shardingsphere/issues/13817
--
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