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/07/12 20:07:55 UTC

[GitHub] [shardingsphere] stephensuxun opened a new issue #11293: 使用mybatis-plus添加数据报错

stephensuxun opened a new issue #11293:
URL: https://github.com/apache/shardingsphere/issues/11293


   使用sharding JDBC 版本4.1.1 
   <dependency>
               <groupId>com.baomidou</groupId>
               <artifactId>mybatis-plus-boot-starter</artifactId>
               <version>3.4.1</version>
     </dependency>
           <!--依赖sharding-jdbc start-->
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
               <version>4.1.1</version>
           </dependency>
   
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-jdbc-spring-namespace</artifactId>
               <version>4.1.1</version>
           </dependency>
   
           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>sharding-core-common</artifactId>
               <version>4.1.1</version>
           </dependency>
   
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-jdbc</artifactId>
               <version>2.5.2</version>
           </dependency>
   <!--依赖sharding-jdbc end -->
   
   分表配置
   # 配置默认数据源
   # 命名数据源  这个是自定义的
   spring.shardingsphere.datasource.names=ds-0,ds-1
   # 配置默认数据源ds-0
   spring.shardingsphere.sharding.default-data-source-name=ds-0
   
   # ds-0数据源
   spring.shardingsphere.datasource.ds-0.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.ds-0.driver-class-name=com.mysql.cj.jdbc.Driver
   spring.shardingsphere.datasource.ds-0.url=jdbc:mysql://172.16.20.3:3306/ainewssystem-cloud?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
   spring.shardingsphere.datasource.ds-0.username=***
   spring.shardingsphere.datasource.ds-0.password=***
   
   # ds-1数据源
   spring.shardingsphere.datasource.ds-1.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.ds-1.driver-class-name=com.mysql.cj.jdbc.Driver
   spring.shardingsphere.datasource.ds-1.url=jdbc:mysql://172.16.20.3:3306/ainewssystem-cloud?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
   spring.shardingsphere.datasource.ds-1.username=***
   spring.shardingsphere.datasource.ds-1.password=***
   
   
   # 配置分片表 ainews_user
   # 配置真实数据节点  库:ds-0,ds-1;表:ainews_user_0,ainews_user_1
   spring.shardingsphere.sharding.tables.ainews_user.actual-data-nodes=ds-$->{0..1}.ainews_user_$->{0..1}
   # 分表分片
   spring.shardingsphere.sharding.tables.ainews_user.table-strategy.inline.sharding-column=user_id
   spring.shardingsphere.sharding.tables.ainews_user.table-strategy.inline.algorithm-expression=ainews_user_->{user_id % 2}
   # 配置自增主键字段
   spring.shardingsphere.sharding.tables.ainews_user.key-generator.column=user_id
   # 自增主键ID 生成方案:雪花算法
   spring.shardingsphere.sharding.tables.ainews_user.key-generator.type=SNOWFLAKE
   
   ##查看sql的输出日志
   spring.shardingsphere.props.sql.show=true
   ##一个实体类对应两张表的设置
   spring.main.allow-bean-definition-overriding = true
   
   创建ainews_user_0表
   CREATE TABLE `ainews_user_0`  (
     `user_id` bigint(20) NOT NULL COMMENT '用户ID',
     `user_account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户账号',
     `user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户名',
     `nick_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户昵称',
     `user_password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户密码',
     `user_header_portrait` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户的头像',
     `user_email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户的邮箱地址',
     `user_used_amount` int(11) NULL DEFAULT 0 COMMENT '用户使用的数量',
     `user_total_usage` int(20) NULL DEFAULT 0 COMMENT '用户使用的总量',
     `user_salt` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户的盐值',
     `user_secret` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL COMMENT '用户的密文',
     `user_status` int(2) NULL DEFAULT 1 COMMENT '用户的状态 0代表冻结 1代表正常',
     `user_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT '0' COMMENT '用户的类型 -1测试 0普通用户 1付费用户 2普通企业 3付费企业',
     `is_authentication` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT '-1' COMMENT '是否通过认证 -1未认证 1个人认证 2企业认证 3代表审核中',
     `user_grade` int(11) NULL DEFAULT 1 COMMENT '用户的等级',
     `user_point` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT '0' COMMENT '用户的积分',
     `user_create_amount` int(11) NULL DEFAULT 0 COMMENT '用户创作的数量',
     `user_collect_amount` int(11) NULL DEFAULT 0 COMMENT '用户收藏的数量',
     `expiration_date` datetime(0) NULL DEFAULT NULL COMMENT '到期时间',
     `create_time` datetime(0) NULL DEFAULT NULL COMMENT '用户注册时间',
     `update_time` datetime(0) NULL DEFAULT NULL COMMENT '用户更新时间',
     `version` int(11) NULL DEFAULT 0 COMMENT '乐观锁',
     `deleted` int(2) NULL DEFAULT 0 COMMENT '逻辑删除',
     `token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL COMMENT '用户的token',
     PRIMARY KEY (`user_id`) USING BTREE
   ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_520_ci COMMENT = '人工智能语音平台用户表' ROW_FORMAT = Dynamic;
   
   创建ainews_user_1表
   CREATE TABLE `ainews_user_1`  (
     `user_id` bigint(20) NOT NULL COMMENT '用户ID',
     `user_account` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户账号',
     `user_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户名',
     `nick_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户昵称',
     `user_password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户密码',
     `user_header_portrait` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户的头像',
     `user_email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户的邮箱地址',
     `user_used_amount` int(11) NULL DEFAULT 0 COMMENT '用户使用的数量',
     `user_total_usage` int(20) NULL DEFAULT 0 COMMENT '用户使用的总量',
     `user_salt` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT NULL COMMENT '用户的盐值',
     `user_secret` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL COMMENT '用户的密文',
     `user_status` int(2) NULL DEFAULT 1 COMMENT '用户的状态 0代表冻结 1代表正常',
     `user_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT '0' COMMENT '用户的类型 -1测试 0普通用户 1付费用户 2普通企业 3付费企业',
     `is_authentication` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT '-1' COMMENT '是否通过认证 -1未认证 1个人认证 2企业认证 3代表审核中',
     `user_grade` int(11) NULL DEFAULT 1 COMMENT '用户的等级',
     `user_point` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL DEFAULT '0' COMMENT '用户的积分',
     `user_create_amount` int(11) NULL DEFAULT 0 COMMENT '用户创作的数量',
     `user_collect_amount` int(11) NULL DEFAULT 0 COMMENT '用户收藏的数量',
     `expiration_date` datetime(0) NULL DEFAULT NULL COMMENT '到期时间',
     `create_time` datetime(0) NULL DEFAULT NULL COMMENT '用户注册时间',
     `update_time` datetime(0) NULL DEFAULT NULL COMMENT '用户更新时间',
     `version` int(11) NULL DEFAULT 0 COMMENT '乐观锁',
     `deleted` int(2) NULL DEFAULT 0 COMMENT '逻辑删除',
     `token` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NULL COMMENT '用户的token',
     PRIMARY KEY (`user_id`) USING BTREE
   ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_520_ci COMMENT = '人工智能语音平台用户表' ROW_FORMAT = Dynamic;
   
   提交的参数
   
   {
     "userAccount": "13186038211",
     "userName": "kevin",
     "userPassword": "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92",
     "verificationCode": "123456"
   }
   
   报错
   2021-07-12 19:47:09.712  WARN 1823 --- [nio-7091-exec-1] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
   ### Error updating database.  Cause: java.lang.IllegalStateException: no table route info
   ### The error may exist in com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.java (best guess)
   ### The error may involve com.ainewssystem.cloud.user.core.user.mapper.AiNewsUserMapper.insert-Inline
   ### The error occurred while setting parameters
   ### SQL: INSERT INTO ainews_user  ( user_id, user_account, user_name, nick_name, user_password,   user_used_amount,           expiration_date, create_time, update_time )  VALUES  ( ?, ?, ?, ?, ?,   ?,           ?, ?, ? )
   ### Cause: java.lang.IllegalStateException: no table route info]
   是否与mybatis plus兼容


-- 
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] yx9o commented on issue #11293: 使用mybatis-plus添加数据报错

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


   Hi@stephensuxun, please refer to the issue submission specification, please modify the title and content description to English, thank 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.

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 #11293: Adding data error using mybatis plus

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


   hi, First adjust the content of the question to English Please!Then  You can use:
   
   `spring.shardingsphere.datasource.names=ds0,ds1
   
   spring.shardingsphere.datasource.common.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.ds0.username=root
   spring.shardingsphere.datasource.ds0.password=123456
   spring.shardingsphere.datasource.ds0.url=jdbc:mysql://127.0.0.1:3306/ainewssystem_cloud_0?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
   
   spring.shardingsphere.datasource.ds0.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.ds1.username=root
   spring.shardingsphere.datasource.ds1.password=123456
   spring.shardingsphere.datasource.ds1.url=jdbc:mysql://127.0.0.1:3306/ainewssystem_cloud_1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
   spring.shardingsphere.datasource.ds1.type=com.alibaba.druid.pool.DruidDataSource
   
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.props.algorithm-expression=ainews_user_$->{user_id % 2}
   
   spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.props.algorithm-expression=ds$->{user_id % 2}
   
   
   spring.shardingsphere.rules.sharding.tables.ainews_user_.actual-data-nodes=ds$->{0..1}.ainews_user_$->{0..1}
   
   spring.shardingsphere.rules.sharding.tables.ainews_user_.database-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user_.database-strategy.standard.sharding-algorithm-name=database-inline
   
   spring.shardingsphere.rules.sharding.tables.ainews_user_.table-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user_.table-strategy.standard.sharding-algorithm-name=table-inline
   
   
   spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
   spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
   
   
   ##查看sql的输出日志
   spring.shardingsphere.props.sql.show=true`


-- 
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 #11293: Adding data error using mybatis plus

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


   **For English only**, other languages will not accept.


-- 
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] stephensuxun edited a comment on issue #11293: Adding data error using mybatis plus

Posted by GitBox <gi...@apache.org>.
stephensuxun edited a comment on issue #11293:
URL: https://github.com/apache/shardingsphere/issues/11293#issuecomment-878731765


   Now using the 5.0.0 version of sparing JDBC can be started, but when using mybatis plus to select data, an error is reported
   
   
   
   2021-07-13 10:31:03.110 ERROR 3008 --- [nio-7091-exec-7] c.a.c.u.c.exception.AppExceptionHandler  : 抛出异常 ERROR ======> 
   
   org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   ### The error may exist in com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.java (best guess)
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: SELECT user_id,user_account,user_name,nick_name,user_password,user_header_portrait,user_email,user_used_amount AS usedAmount,user_total_usage,user_salt,user_secret,user_status,user_type,is_authentication,user_grade,user_point,user_create_amount,user_collect_amount,expiration_date,create_time,update_time,token,version,deleted FROM ainews_user WHERE user_id=?  AND deleted=0
   ### Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:96) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at com.sun.proxy.$Proxy213.selectOne(Unknown Source) ~[na:na]
   	at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:89) ~[mybatis-plus-core-3.4.3.jar:3.4.3]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) ~[mybatis-plus-core-3.4.3.jar:3.4.3]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.4.3.jar:3.4.3]
   	at com.sun.proxy.$Proxy221.selectById(Unknown Source) ~[na:na]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at com.sun.proxy.$Proxy222.selectById(Unknown Source) ~[na:na]
   	at com.ainewssystem.cloud.user.core.user.service.AiNewsUserService.updateUserSecret(AiNewsUserService.java:179) ~[classes/:na]
   	at com.ainewssystem.cloud.user.core.user.service.AiNewsUserService.userRegistration(AiNewsUserService.java:90) ~[classes/:na]
   	at com.ainewssystem.cloud.user.core.user.controller.UserController.userRegistration(UserController.java:43) ~[classes/:na]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) [spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) [tomcat-embed-core-9.0.38.jar:4.0.FR]
   	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) [tomcat-embed-core-9.0.38.jar:4.0.FR]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_211]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_211]
   	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_211]
   Caused by: org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   ### The error may exist in com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.java (best guess)
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: SELECT user_id,user_account,user_name,nick_name,user_password,user_header_portrait,user_email,user_used_amount AS usedAmount,user_total_usage,user_salt,user_secret,user_status,user_type,is_authentication,user_grade,user_point,user_create_amount,user_collect_amount,expiration_date,create_time,update_time,token,version,deleted FROM ainews_user WHERE user_id=?  AND deleted=0
   ### Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:153) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76) ~[mybatis-3.5.7.jar:3.5.7]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	... 70 common frames omitted
   Caused by: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:71) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:48) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:58) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at Script4$_run_closure1.doCall(Script4.groovy:1) ~[na:na]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at groovy.lang.Closure.call(Closure.java:420) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at groovy.lang.Closure.call(Closure.java:414) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.apache.shardingsphere.sharding.algorithm.sharding.inline.InlineShardingAlgorithm.doSharding(InlineShardingAlgorithm.java:69) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.strategy.type.standard.StandardShardingStrategy.doSharding(StandardShardingStrategy.java:68) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.strategy.type.standard.StandardShardingStrategy.doSharding(StandardShardingStrategy.java:57) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeDataSources(ShardingStandardRoutingEngine.java:203) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route0(ShardingStandardRoutingEngine.java:191) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditionsWithCondition(ShardingStandardRoutingEngine.java:114) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditions(ShardingStandardRoutingEngine.java:107) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.getDataNodes(ShardingStandardRoutingEngine.java:84) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route(ShardingStandardRoutingEngine.java:69) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:61) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:47) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:62) ~[shardingsphere-infra-route-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:52) ~[shardingsphere-infra-route-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:54) ~[shardingsphere-infra-context-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:46) ~[shardingsphere-infra-context-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createExecutionContext(ShardingSpherePreparedStatement.java:363) ~[shardingsphere-jdbc-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:271) ~[shardingsphere-jdbc-core-5.0.0-beta.jar:5.0.0-beta]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) ~[mybatis-3.5.7.jar:3.5.7]
   	at com.sun.proxy.$Proxy249.execute(Unknown Source) ~[na:na]
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.5.7.jar:3.5.7]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:64) ~[mybatis-3.5.7.jar:3.5.7]
   	at com.sun.proxy.$Proxy247.query(Unknown Source) ~[na:na]
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.7.jar:3.5.7]
   	at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) ~[mybatis-plus-extension-3.4.3.jar:3.4.3]
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62) ~[mybatis-3.5.7.jar:3.5.7]
   	at com.sun.proxy.$Proxy246.query(Unknown Source) ~[na:na]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151) ~[mybatis-3.5.7.jar:3.5.7]
   	... 78 common frames omitted
   
   2021-07-13 10:31:03.114  WARN 3008 --- [nio-7091-exec-7] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   ### The error may exist in com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.java (best guess)
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: SELECT user_id,user_account,user_name,nick_name,user_password,user_header_portrait,user_email,user_used_amount AS usedAmount,user_total_usage,user_salt,user_secret,user_status,user_type,is_authentication,user_grade,user_point,user_create_amount,user_collect_amount,expiration_date,create_time,update_time,token,version,deleted FROM ainews_user WHERE user_id=?  AND deleted=0
   ### Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)]


-- 
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] stephensuxun commented on issue #11293: 使用mybatis-plus添加数据报错

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






-- 
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] stephensuxun removed a comment on issue #11293: 使用mybatis-plus添加数据报错

Posted by GitBox <gi...@apache.org>.
stephensuxun removed a comment on issue #11293:
URL: https://github.com/apache/shardingsphere/issues/11293#issuecomment-878253717


   现在已经将版本更新到5.0.0-beta
   
   <dependency>
       <groupId>org.apache.shardingsphere</groupId>
       <artifactId>shardingsphere-jdbc-core</artifactId>
       <version>5.0.0-beta</version>
   </dependency>
   配置文件为
   spring.shardingsphere.props.sql-show=true
   spring.shardingsphere.datasource.common.driver-class-name=com.mysql.cj.jdbc.Driver
   spring.shardingsphere.datasource.names=ds0
   spring.shardingsphere.datasource.ds0.username=root
   spring.shardingsphere.datasource.ds0.password=st18ts!20
   spring.shardingsphere.datasource.ds0.url=jdbc:mysql://172.16.20.3:3306/ainewssystem-cloud?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
   spring.shardingsphere.datasource.ds0.type=com.alibaba.druid.pool.DruidDataSource
   
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.props.algorithm-expression=ainews_user_$->{user_id % 2}
   spring.shardingsphere.rules.sharding.tables.t_user.actual-data-nodes=ds0.ainews_user_$->{0..1}
   spring.shardingsphere.rules.sharding.tables.t_user.table-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.t_user.table-strategy.standard.sharding-algorithm-name=table-inline
   spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
   spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
   
   ##查看sql的输出日志
   spring.shardingsphere.props.sql.show=true
   ##一个实体类对应两张表的设置
   spring.main.allow-bean-definition-overriding = true
   
   启动报错为
   
   Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
   2021-07-12 20:49:55.658 ERROR 3664 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed
   
   org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'aiNewsUserService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aiNewsUserService': Unsatisfied dependency expressed through field 'aiNewsUserMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aiNewsUserMapper' defined in file [/usr/local/var/www/handehand/AinewSystem/ainewssystem_cloud_api/ainewssystem-cloud-api/ainewssystem-user/target/classes/com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
   	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
   	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
   	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
   	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.4.RELEASE.jar:2.3.4.RELEASE]
   	at com.ainewssystem.cloud.user.AiUserApplication.main(AiUserApplication.java:24) [classes/:na]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-2.3.4.RELEASE.jar:2.3.4.RELEASE]
   Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aiNewsUserService': Unsatisfied dependency expressed through field 'aiNewsUserMapper'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aiNewsUserMapper' defined in file [/usr/local/var/www/handehand/AinewSystem/ainewssystem_cloud_api/ainewssystem-cloud-api/ainewssystem-user/target/classes/com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
   	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	... 25 common frames omitted
   Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aiNewsUserMapper' defined in file [/usr/local/var/www/handehand/AinewSystem/ainewssystem_cloud_api/ainewssystem-cloud-api/ainewssystem-user/target/classes/com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.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) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	... 38 common frames omitted
   Caused by: java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
   	at org.springframework.util.Assert.notNull(Assert.java:201) ~[spring-core-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.mybatis.spring.support.SqlSessionDaoSupport.checkDaoConfig(SqlSessionDaoSupport.java:122) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at org.mybatis.spring.mapper.MapperFactoryBean.checkDaoConfig(MapperFactoryBean.java:73) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at org.springframework.dao.support.DaoSupport.afterPropertiesSet(DaoSupport.java:44) ~[spring-tx-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790) ~[spring-beans-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	... 48 common frames omitted
   
   2021-07-12 20:49:56.538  WARN 3664 --- [      Thread-22] c.a.nacos.common.notify.NotifyCenter     : [NotifyCenter] Start destroying Publisher
   2021-07-12 20:49:56.539  WARN 3664 --- [      Thread-13] c.a.n.common.http.HttpClientBeanHolder   : [HttpClientBeanHolder] Start destroying common HttpClient
   2021-07-12 20:49:56.539  WARN 3664 --- [      Thread-22] c.a.nacos.common.notify.NotifyCenter     : [NotifyCenter] Destruction of the end
   2021-07-12 20:49:56.540  WARN 3664 --- [      Thread-13] c.a.n.common.http.HttpClientBeanHolder   : [HttpClientBeanHolder] Destruction of the end
   
   Process finished with exit code 1


-- 
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] stephensuxun edited a comment on issue #11293: 使用mybatis-plus添加数据报错

Posted by GitBox <gi...@apache.org>.
stephensuxun edited a comment on issue #11293:
URL: https://github.com/apache/shardingsphere/issues/11293#issuecomment-878253717






-- 
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] stephensuxun commented on issue #11293: Adding data error using mybatis plus

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


   Now using the 5.0.0 version of sparing JDBC can be started, but when using mybatis plus to write data, an error is reported
   
   
   
   2021-07-13 10:31:03.110 ERROR 3008 --- [nio-7091-exec-7] c.a.c.u.c.exception.AppExceptionHandler  : 抛出异常 ERROR ======> 
   
   org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   ### The error may exist in com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.java (best guess)
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: SELECT user_id,user_account,user_name,nick_name,user_password,user_header_portrait,user_email,user_used_amount AS usedAmount,user_total_usage,user_salt,user_secret,user_status,user_type,is_authentication,user_grade,user_point,user_create_amount,user_collect_amount,expiration_date,create_time,update_time,token,version,deleted FROM ainews_user WHERE user_id=?  AND deleted=0
   ### Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   	at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:96) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at com.sun.proxy.$Proxy213.selectOne(Unknown Source) ~[na:na]
   	at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:160) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:89) ~[mybatis-plus-core-3.4.3.jar:3.4.3]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) ~[mybatis-plus-core-3.4.3.jar:3.4.3]
   	at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.4.3.jar:3.4.3]
   	at com.sun.proxy.$Proxy221.selectById(Unknown Source) ~[na:na]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139) ~[spring-tx-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at com.sun.proxy.$Proxy222.selectById(Unknown Source) ~[na:na]
   	at com.ainewssystem.cloud.user.core.user.service.AiNewsUserService.updateUserSecret(AiNewsUserService.java:179) ~[classes/:na]
   	at com.ainewssystem.cloud.user.core.user.service.AiNewsUserService.userRegistration(AiNewsUserService.java:90) ~[classes/:na]
   	at com.ainewssystem.cloud.user.core.user.controller.UserController.userRegistration(UserController.java:43) ~[classes/:na]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) [spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) [tomcat-embed-core-9.0.38.jar:4.0.FR]
   	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) [tomcat-embed-core-9.0.38.jar:4.0.FR]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.9.RELEASE.jar:5.2.9.RELEASE]
   	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_211]
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_211]
   	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.38.jar:9.0.38]
   	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_211]
   Caused by: org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   ### The error may exist in com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.java (best guess)
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: SELECT user_id,user_account,user_name,nick_name,user_password,user_header_portrait,user_email,user_used_amount AS usedAmount,user_total_usage,user_salt,user_secret,user_status,user_type,is_authentication,user_grade,user_point,user_create_amount,user_collect_amount,expiration_date,create_time,update_time,token,version,deleted FROM ainews_user WHERE user_id=?  AND deleted=0
   ### Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:153) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:76) ~[mybatis-3.5.7.jar:3.5.7]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:427) ~[mybatis-spring-2.0.6.jar:2.0.6]
   	... 70 common frames omitted
   Caused by: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:71) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:48) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:58) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at Script4$_run_closure1.doCall(Script4.groovy:1) ~[na:na]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at groovy.lang.Closure.call(Closure.java:420) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at groovy.lang.Closure.call(Closure.java:414) ~[groovy-2.4.19-indy.jar:2.4.19]
   	at org.apache.shardingsphere.sharding.algorithm.sharding.inline.InlineShardingAlgorithm.doSharding(InlineShardingAlgorithm.java:69) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.strategy.type.standard.StandardShardingStrategy.doSharding(StandardShardingStrategy.java:68) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.strategy.type.standard.StandardShardingStrategy.doSharding(StandardShardingStrategy.java:57) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeDataSources(ShardingStandardRoutingEngine.java:203) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route0(ShardingStandardRoutingEngine.java:191) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditionsWithCondition(ShardingStandardRoutingEngine.java:114) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.routeByShardingConditions(ShardingStandardRoutingEngine.java:107) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.getDataNodes(ShardingStandardRoutingEngine.java:84) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.type.standard.ShardingStandardRoutingEngine.route(ShardingStandardRoutingEngine.java:69) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:61) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.sharding.route.engine.ShardingSQLRouter.createRouteContext(ShardingSQLRouter.java:47) ~[shardingsphere-sharding-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.infra.route.engine.impl.PartialSQLRouteExecutor.route(PartialSQLRouteExecutor.java:62) ~[shardingsphere-infra-route-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.infra.route.engine.SQLRouteEngine.route(SQLRouteEngine.java:52) ~[shardingsphere-infra-route-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.route(KernelProcessor.java:54) ~[shardingsphere-infra-context-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.infra.context.kernel.KernelProcessor.generateExecutionContext(KernelProcessor.java:46) ~[shardingsphere-infra-context-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.createExecutionContext(ShardingSpherePreparedStatement.java:363) ~[shardingsphere-jdbc-core-5.0.0-beta.jar:5.0.0-beta]
   	at org.apache.shardingsphere.driver.jdbc.core.statement.ShardingSpherePreparedStatement.execute(ShardingSpherePreparedStatement.java:271) ~[shardingsphere-jdbc-core-5.0.0-beta.jar:5.0.0-beta]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) ~[mybatis-3.5.7.jar:3.5.7]
   	at com.sun.proxy.$Proxy249.execute(Unknown Source) ~[na:na]
   	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79) ~[mybatis-3.5.7.jar:3.5.7]
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
   	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:64) ~[mybatis-3.5.7.jar:3.5.7]
   	at com.sun.proxy.$Proxy247.query(Unknown Source) ~[na:na]
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:325) ~[mybatis-3.5.7.jar:3.5.7]
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) ~[mybatis-3.5.7.jar:3.5.7]
   	at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:81) ~[mybatis-plus-extension-3.4.3.jar:3.4.3]
   	at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62) ~[mybatis-3.5.7.jar:3.5.7]
   	at com.sun.proxy.$Proxy246.query(Unknown Source) ~[na:na]
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:151) ~[mybatis-3.5.7.jar:3.5.7]
   	... 78 common frames omitted
   
   2021-07-13 10:31:03.114  WARN 3008 --- [nio-7091-exec-7] .m.m.a.ExceptionHandlerExceptionResolver : Resolved [org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
   ### Error querying database.  Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)
   ### The error may exist in com/ainewssystem/cloud/user/core/user/mapper/AiNewsUserMapper.java (best guess)
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: SELECT user_id,user_account,user_name,nick_name,user_password,user_header_portrait,user_email,user_used_amount AS usedAmount,user_total_usage,user_salt,user_secret,user_status,user_type,is_authentication,user_grade,user_point,user_create_amount,user_collect_amount,expiration_date,create_time,update_time,token,version,deleted FROM ainews_user WHERE user_id=?  AND deleted=0
   ### Cause: groovy.lang.MissingMethodException: No signature of method: java.lang.String.mod() is applicable for argument types: (java.lang.Integer) values: [2]
   Possible solutions: drop(int), find(), any(), find(java.lang.CharSequence), any(groovy.lang.Closure), find(groovy.lang.Closure)]


-- 
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 edited a comment on issue #11293: Adding data error using mybatis plus

Posted by GitBox <gi...@apache.org>.
zjcnb edited a comment on issue #11293:
URL: https://github.com/apache/shardingsphere/issues/11293#issuecomment-878397240


   hi, First adjust the content of the question to English Please!Then  You can use:
   
   spring.shardingsphere.datasource.names=ds0,ds1
   
   spring.shardingsphere.datasource.common.driver-class-name=com.mysql.jdbc.Driver
   spring.shardingsphere.datasource.ds0.username=root
   spring.shardingsphere.datasource.ds0.password=123456
   spring.shardingsphere.datasource.ds0.url=jdbc:mysql://127.0.0.1:3306/ainewssystem_cloud_0?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
   
   spring.shardingsphere.datasource.ds0.type=com.alibaba.druid.pool.DruidDataSource
   spring.shardingsphere.datasource.ds1.username=root
   spring.shardingsphere.datasource.ds1.password=123456
   spring.shardingsphere.datasource.ds1.url=jdbc:mysql://127.0.0.1:3306/ainewssystem_cloud_1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2b8
   spring.shardingsphere.datasource.ds1.type=com.alibaba.druid.pool.DruidDataSource
   
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.table-inline.props.algorithm-expression=ainews_user_$->{user_id % 2}
   
   spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.type=INLINE
   spring.shardingsphere.rules.sharding.sharding-algorithms.database-inline.props.algorithm-expression=ds$->{user_id % 2}
   
   
   spring.shardingsphere.rules.sharding.tables.ainews_user_.actual-data-nodes=ds$->{0..1}.ainews_user_$->{0..1}
   
   spring.shardingsphere.rules.sharding.tables.ainews_user_.database-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user_.database-strategy.standard.sharding-algorithm-name=database-inline
   
   spring.shardingsphere.rules.sharding.tables.ainews_user_.table-strategy.standard.sharding-column=user_id
   spring.shardingsphere.rules.sharding.tables.ainews_user_.table-strategy.standard.sharding-algorithm-name=table-inline
   
   
   spring.shardingsphere.rules.sharding.key-generators.snowflake.type=SNOWFLAKE
   spring.shardingsphere.rules.sharding.key-generators.snowflake.props.worker-id=123
   
   
   ##查看sql的输出日志
   spring.shardingsphere.props.sql.show=true


-- 
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 #11293: Adding data error using mybatis plus

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #11293:
URL: https://github.com/apache/shardingsphere/issues/11293


   


-- 
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