apache / shardingsphere

Empowering Data Intelligence with Distributed SQL for Sharding, Scalability, and Security Across All Databases.
Apache License 2.0
19.96k stars 6.74k forks source link

insert data failed : no routeConditions info: line 16:0 no viable alternative at input '(ID,VERSION_COL,USER' #12760

Closed jinghuaj closed 3 years ago

jinghuaj commented 3 years ago

For English only, other languages will not accept.

Before report a bug, make sure you have:

Searched open and closed GitHub issues.
Read documentation: ShardingSphere Doc.

Please pay attention on issues you submitted, because we maybe need more details. If no response more than 7 days 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? 4.0.0-RC1 binary

Which project did you use? Sharding-JDBC or Sharding-Proxy? Sharding-JDBC + mybatis-plus 3.1.2

Expected behavior

insert into table by routeConditions subdatabase Logic SQL: INSERT INTO eam_alarm ( ID, Actual SQL: ds1 ::: INSERT INTO eam_alarm

Actual behavior

Logic SQL: INSERT INTO eam_alarm ( ID, Actual SQL: ds1 ::: INSERT INTO eam_alarm Actual SQL: ds2 ::: INSERT INTO eam_alarm

application.properties

server.port=8099 server.servlet.context-path=/sharding

配置不同的数据源

spring.shardingsphere.datasource.names=ds1,ds2

配置ds1数据源的基本信息

spring.shardingsphere.datasource.ds1.type=com.alibaba.druid.pool.DruidDataSource spring.shardingsphere.datasource.ds1.driver-class-name=com.mysql.jdbc.Driver spring.shardingsphere.datasource.ds1.url=jdbc:mysql://10.128.5.211:3306/ds1?serverTimezone=GMT%2B8&useAffectedRows=true spring.shardingsphere.datasource.ds1.username=root spring.shardingsphere.datasource.ds1.password=aiops@1qaz2wsx

配置ds2数据源的基本信息

spring.shardingsphere.datasource.ds2.type=com.alibaba.druid.pool.DruidDataSource spring.shardingsphere.datasource.ds2.driver-class-name=com.mysql.jdbc.Driver spring.shardingsphere.datasource.ds2.url=jdbc:mysql://10.128.5.211:3306/ds2?serverTimezone=GMT%2B8&useAffectedRows=true spring.shardingsphere.datasource.ds2.username=root spring.shardingsphere.datasource.ds2.password=aiops@1qaz2wsx

指定库分片策略,根据USER的奇偶性来添加到不同的库中

spring.shardingsphere.sharding.default-database-strategy.standard.shardingColumn=user spring.shardingsphere.sharding.default-database-strategy.standard.preciseAlgorithmClassName=com.aiops.algorithm.SubDataBasePreciseAlgorithm

spring.shardingsphere.sharding.binding-tables=eam_alarm spring.shardingsphere.sharding.broadcast-tables=alarm_time_log 指定eam_alarm表的主键生成策略 spring.shardingsphere.sharding.tables.eam_alarm.key-generator.column=id spring.shardingsphere.sharding.tables.eam_alarm.key-generator.type=SNOWFLAKE

打开sql输出日志

spring.shardingsphere.props.sql.show=true spring.main.allow-bean-definition-overriding=true

spring.shardingsphere.sharding.default-database-strategy.standard.preciseAlgorithmClassName=com.aiops.algorithm.DbShardingAlgorithm

mybatis plus

mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml mybatis-plus.typeAliasesPackage=com.aiops.entity mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

mybatis-plus.global-config.db-config.logic-delete-value=1 mybatis-plus.global-config.db-config.logic-not-delete-value=0

SubDataBasePreciseAlgorithm:

package com.aiops.algorithm;

import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm; import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue; import org.springframework.stereotype.Service;

import java.util.Collection; import java.util.Objects;

@Service public class SubDataBasePreciseAlgorithm implements PreciseShardingAlgorithm {

@Override
public String doSharding(Collection<String> collection, PreciseShardingValue<String> preciseShardingValue) {
    for (String databaseName : collection) {
        String zoneValue = String.valueOf(preciseShardingValue.getValue());
        System.out.println("========================>dosharding" + zoneValue);
        zoneValue = String.valueOf(Integer.valueOf(preciseShardingValue.getValue()) % 2 + 1);
        if (databaseName.endsWith(zoneValue)) {
            System.out.println("=================>databaseName" + databaseName);
            return databaseName;
        }
    }
    throw new IllegalArgumentException();
}

}

sql to create tables:

ds1:

create table ds1.eam_alarm ( ID bigint auto_increment primary key, VERSION_COL bigint default 1 not null, CID int null, ALARM_TYPE varchar(20) collate utf8_bin null, ALARM_NAME text collate utf8_bin null, ENTITY_NAME varchar(800) collate utf8_bin null, HOST_IP varchar(20) collate utf8_bin null, STATUS varchar(10) collate utf8_bin null, PRIORITY int null, ALARM_CONTENT text null, CREATE_TIME bigint null, UPDATE_TIME bigint null, CLOSE_TIME bigint null, ENTITY_ID varchar(250) collate utf8_bin null, ALERT_DEF_ID int null, USER varchar(50) collate utf8_bin null, POLICY_ID varchar(50) collate utf8_bin null, SOURCE varchar(50) collate utf8_bin null, APP varchar(50) collate utf8_bin null, EVENT_ID varchar(250) collate utf8_bin null, SOURCE_URL varchar(4000) collate utf8_bin null, EXT int(2) default 0 null, ACK_TIME bigint null, ACK_USER varchar(50) collate utf8_bin null, CLOSE_USER varchar(50) collate utf8_bin null, CLOSE_COMMENTS varchar(4000) collate utf8_bin null, AUTO_RESOLVE bigint(50) default 0 null, HOST varchar(128) collate utf8_bin null, SERVICE varchar(128) collate utf8_bin null, METRIC varchar(128) collate utf8_bin null, TAG text collate utf8_bin null, PARENT_ALARM_ID int(11) unsigned zerofill default 0 null, ALARM_VERSION int(2) default 0 null, AUTO_RESOLVE_TIME bigint null, IS_ACTIVE int null, ACTIVE_COUNT int default 0 null, ACTIVE_ALARM varchar(1280) collate utf8_bin null, TASK_ID varchar(64) null, APPLICATION varchar(128) null, MODEL varchar(128) null, DETAILS text null, CONTEXTS text null );

ds2:

create table ds2.eam_alarm ( ID bigint auto_increment primary key, VERSION_COL bigint default 1 not null, CID int null, ALARM_TYPE varchar(20) collate utf8_bin null, ALARM_NAME text collate utf8_bin null, ENTITY_NAME varchar(800) collate utf8_bin null, HOST_IP varchar(20) collate utf8_bin null, STATUS varchar(10) collate utf8_bin null, PRIORITY int null, ALARM_CONTENT text null, CREATE_TIME bigint null, UPDATE_TIME bigint null, CLOSE_TIME bigint null, ENTITY_ID varchar(250) collate utf8_bin null, ALERT_DEF_ID int null, USER varchar(50) collate utf8_bin null, POLICY_ID varchar(50) collate utf8_bin null, SOURCE varchar(50) collate utf8_bin null, APP varchar(50) collate utf8_bin null, EVENT_ID varchar(250) collate utf8_bin null, SOURCE_URL varchar(4000) collate utf8_bin null, EXT int(2) default 0 null, ACK_TIME bigint null, ACK_USER varchar(50) collate utf8_bin null, CLOSE_USER varchar(50) collate utf8_bin null, CLOSE_COMMENTS varchar(4000) collate utf8_bin null, AUTO_RESOLVE bigint(50) default 0 null, HOST varchar(128) collate utf8_bin null, SERVICE varchar(128) collate utf8_bin null, METRIC varchar(128) collate utf8_bin null, TAG text collate utf8_bin null, PARENT_ALARM_ID int(11) unsigned zerofill default 0 null, ALARM_VERSION int(2) default 0 null, AUTO_RESOLVE_TIME bigint null, IS_ACTIVE int null, ACTIVE_COUNT int default 0 null, ACTIVE_ALARM varchar(1280) collate utf8_bin null, TASK_ID varchar(64) null, APPLICATION varchar(128) null, MODEL varchar(128) null, DETAILS text null, CONTEXTS text null );

logs/stdout.log

D:\Java\jdk1.8.0_60\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2020.1.4\lib\idea_rt.jar=49230:D:\Program Files\JetBrains\IntelliJ IDEA 2020.1.4\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\JetBrains\IntelliJ IDEA 2020.1.4\lib\idea_rt.jar;D:\Program Files\JetBrains\IntelliJ IDEA 2020.1.4\plugins\junit\lib\junit5-rt.jar;D:\Program Files\JetBrains\IntelliJ IDEA 2020.1.4\plugins\junit\lib\junit-rt.jar;D:\Java\jdk1.8.0_60\jre\lib\charsets.jar;D:\Java\jdk1.8.0_60\jre\lib\deploy.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\access-bridge-64.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\cldrdata.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\dnsns.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\jaccess.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\jfxrt.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\localedata.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\nashorn.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\sunec.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\sunjce_provider.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\sunmscapi.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\sunpkcs11.jar;D:\Java\jdk1.8.0_60\jre\lib\ext\zipfs.jar;D:\Java\jdk1.8.0_60\jre\lib\javaws.jar;D:\Java\jdk1.8.0_60\jre\lib\jce.jar;D:\Java\jdk1.8.0_60\jre\lib\jfr.jar;D:\Java\jdk1.8.0_60\jre\lib\jfxswt.jar;D:\Java\jdk1.8.0_60\jre\lib\jsse.jar;D:\Java\jdk1.8.0_60\jre\lib\management-agent.jar;D:\Java\jdk1.8.0_60\jre\lib\plugin.jar;D:\Java\jdk1.8.0_60\jre\lib\resources.jar;D:\Java\jdk1.8.0_60\jre\lib\rt.jar;D:\Java\workspace\Rui\shardingsphere-daemon\sharding_sublib_20210830\target\test-classes;D:\Java\workspace\Rui\shardingsphere-daemon\sharding_sublib_20210830\target\classes;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-starter-web\2.1.7.RELEASE\spring-boot-starter-web-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-starter\2.1.7.RELEASE\spring-boot-starter-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.1.7.RELEASE\spring-boot-starter-logging-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\Aiops.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\Aiops.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;C:\Users\Aiops.m2\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;C:\Users\Aiops.m2\repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;C:\Users\Aiops.m2\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;C:\Users\Aiops.m2\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-starter-json\2.1.7.RELEASE\spring-boot-starter-json-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;C:\Users\Aiops.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\Aiops.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;C:\Users\Aiops.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;C:\Users\Aiops.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;C:\Users\Aiops.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.7.RELEASE\spring-boot-starter-tomcat-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.22\tomcat-embed-core-9.0.22.jar;C:\Users\Aiops.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.22\tomcat-embed-el-9.0.22.jar;C:\Users\Aiops.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.22\tomcat-embed-websocket-9.0.22.jar;C:\Users\Aiops.m2\repository\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;C:\Users\Aiops.m2\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;C:\Users\Aiops.m2\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;C:\Users\Aiops.m2\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-web\5.1.9.RELEASE\spring-web-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-beans\5.1.9.RELEASE\spring-beans-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-webmvc\5.1.9.RELEASE\spring-webmvc-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-aop\5.1.9.RELEASE\spring-aop-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-context\5.1.9.RELEASE\spring-context-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-expression\5.1.9.RELEASE\spring-expression-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-starter-data-redis\2.1.3.RELEASE\spring-boot-starter-data-redis-2.1.3.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\data\spring-data-redis\2.1.10.RELEASE\spring-data-redis-2.1.10.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\data\spring-data-keyvalue\2.1.10.RELEASE\spring-data-keyvalue-2.1.10.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\data\spring-data-commons\2.1.10.RELEASE\spring-data-commons-2.1.10.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-tx\5.1.9.RELEASE\spring-tx-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-oxm\5.1.9.RELEASE\spring-oxm-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-context-support\5.1.9.RELEASE\spring-context-support-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\io\lettuce\lettuce-core\5.1.8.RELEASE\lettuce-core-5.1.8.RELEASE.jar;C:\Users\Aiops.m2\repository\io\netty\netty-common\4.1.38.Final\netty-common-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\netty\netty-handler\4.1.38.Final\netty-handler-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\netty\netty-buffer\4.1.38.Final\netty-buffer-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\netty\netty-codec\4.1.38.Final\netty-codec-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\netty\netty-transport\4.1.38.Final\netty-transport-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\netty\netty-resolver\4.1.38.Final\netty-resolver-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\projectreactor\reactor-core\3.2.11.RELEASE\reactor-core-3.2.11.RELEASE.jar;C:\Users\Aiops.m2\repository\org\reactivestreams\reactive-streams\1.0.2\reactive-streams-1.0.2.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-starter-webflux\2.1.7.RELEASE\spring-boot-starter-webflux-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-starter-reactor-netty\2.1.7.RELEASE\spring-boot-starter-reactor-netty-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\io\projectreactor\netty\reactor-netty\0.8.10.RELEASE\reactor-netty-0.8.10.RELEASE.jar;C:\Users\Aiops.m2\repository\io\netty\netty-codec-http\4.1.38.Final\netty-codec-http-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\netty\netty-codec-http2\4.1.38.Final\netty-codec-http2-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\netty\netty-handler-proxy\4.1.38.Final\netty-handler-proxy-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\netty\netty-codec-socks\4.1.38.Final\netty-codec-socks-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\io\netty\netty-transport-native-epoll\4.1.38.Final\netty-transport-native-epoll-4.1.38.Final-linux-x86_64.jar;C:\Users\Aiops.m2\repository\io\netty\netty-transport-native-unix-common\4.1.38.Final\netty-transport-native-unix-common-4.1.38.Final.jar;C:\Users\Aiops.m2\repository\org\glassfish\javax.el\3.0.0\javax.el-3.0.0.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-webflux\5.1.9.RELEASE\spring-webflux-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\synchronoss\cloud\nio-multipart-parser\1.1.0\nio-multipart-parser-1.1.0.jar;C:\Users\Aiops.m2\repository\org\synchronoss\cloud\nio-stream-storage\1.1.3\nio-stream-storage-1.1.3.jar;C:\Users\Aiops.m2\repository\com\alibaba\druid\1.1.6\druid-1.1.6.jar;C:\Users\Aiops.m2\repository\mysql\mysql-connector-java\8.0.15\mysql-connector-java-8.0.15.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-jdbc-spring-boot-starter\4.0.0-RC1\sharding-jdbc-spring-boot-starter-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-jdbc-core\4.0.0-RC1\sharding-jdbc-core-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-entry\4.0.0-RC1\sharding-core-entry-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-api\4.0.0-RC1\sharding-core-api-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-common\4.0.0-RC1\sharding-core-common-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\codehaus\groovy\groovy\2.4.5\groovy-2.4.5-indy.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-parse-common\4.0.0-RC1\sharding-core-parse-common-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-parse-spi\4.0.0-RC1\sharding-core-parse-spi-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\commons\commons-collections4\4.2\commons-collections4-4.2.jar;C:\Users\Aiops.m2\repository\org\antlr\antlr4-runtime\4.7.1\antlr4-runtime-4.7.1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-parse-mysql\4.0.0-RC1\sharding-core-parse-mysql-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-parse-postgresql\4.0.0-RC1\sharding-core-parse-postgresql-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-parse-oracle\4.0.0-RC1\sharding-core-parse-oracle-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-parse-sqlserver\4.0.0-RC1\sharding-core-parse-sqlserver-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-optimize\4.0.0-RC1\sharding-core-optimize-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-route\4.0.0-RC1\sharding-core-route-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-rewrite\4.0.0-RC1\sharding-core-rewrite-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-execute\4.0.0-RC1\sharding-core-execute-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-core-merge\4.0.0-RC1\sharding-core-merge-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\org\apache\shardingsphere\sharding-transaction-core\4.0.0-RC1\sharding-transaction-core-4.0.0-RC1.jar;C:\Users\Aiops.m2\repository\com\google\guava\guava\18.0\guava-18.0.jar;C:\Users\Aiops.m2\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;C:\Users\Aiops.m2\repository\org\slf4j\jcl-over-slf4j\1.7.26\jcl-over-slf4j-1.7.26.jar;C:\Users\Aiops.m2\repository\com\alibaba\druid-spring-boot-starter\1.1.14\druid-spring-boot-starter-1.1.14.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.7.RELEASE\spring-boot-autoconfigure-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\2.1.7.RELEASE\spring-boot-starter-jdbc-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-jdbc\5.1.9.RELEASE\spring-jdbc-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\com\baomidou\mybatis-plus-boot-starter\3.1.2\mybatis-plus-boot-starter-3.1.2.jar;C:\Users\Aiops.m2\repository\com\baomidou\mybatis-plus\3.1.2\mybatis-plus-3.1.2.jar;C:\Users\Aiops.m2\repository\com\baomidou\mybatis-plus-extension\3.1.2\mybatis-plus-extension-3.1.2.jar;C:\Users\Aiops.m2\repository\com\baomidou\mybatis-plus-core\3.1.2\mybatis-plus-core-3.1.2.jar;C:\Users\Aiops.m2\repository\com\baomidou\mybatis-plus-annotation\3.1.2\mybatis-plus-annotation-3.1.2.jar;C:\Users\Aiops.m2\repository\com\github\jsqlparser\jsqlparser\1.2\jsqlparser-1.2.jar;C:\Users\Aiops.m2\repository\org\mybatis\mybatis\3.5.1\mybatis-3.5.1.jar;C:\Users\Aiops.m2\repository\org\mybatis\mybatis-spring\2.0.1\mybatis-spring-2.0.1.jar;C:\Users\Aiops.m2\repository\com\baomidou\mybatis-plus-generator\3.1.2\mybatis-plus-generator-3.1.2.jar;C:\Users\Aiops.m2\repository\org\apache\velocity\velocity-engine-core\2.0\velocity-engine-core-2.0.jar;C:\Users\Aiops.m2\repository\org\apache\commons\commons-lang3\3.8.1\commons-lang3-3.8.1.jar;C:\Users\Aiops.m2\repository\org\freemarker\freemarker\2.3.23\freemarker-2.3.23.jar;C:\Users\Aiops.m2\repository\com\mchange\c3p0\0.9.5.2\c3p0-0.9.5.2.jar;C:\Users\Aiops.m2\repository\com\mchange\mchange-commons-java\0.2.11\mchange-commons-java-0.2.11.jar;C:\Users\Aiops.m2\repository\com\alibaba\fastjson\1.2.58\fastjson-1.2.58.jar;C:\Users\Aiops.m2\repository\org\projectlombok\lombok\1.18.8\lombok-1.18.8.jar;C:\Users\Aiops.m2\repository\org\apache\httpcomponents\httpclient\4.5.9\httpclient-4.5.9.jar;C:\Users\Aiops.m2\repository\org\apache\httpcomponents\httpcore\4.4.11\httpcore-4.4.11.jar;C:\Users\Aiops.m2\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot-test\2.1.8.RELEASE\spring-boot-test-2.1.8.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\boot\spring-boot\2.1.7.RELEASE\spring-boot-2.1.7.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-test\5.1.9.RELEASE\spring-test-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-core\5.1.9.RELEASE\spring-core-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\org\springframework\spring-jcl\5.1.9.RELEASE\spring-jcl-5.1.9.RELEASE.jar;C:\Users\Aiops.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\Users\Aiops.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\Aiops.m2\repository\net\sf\json-lib\json-lib\2.4\json-lib-2.4-jdk15.jar;C:\Users\Aiops.m2\repository\commons-beanutils\commons-beanutils\1.8.0\commons-beanutils-1.8.0.jar;C:\Users\Aiops.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\Users\Aiops.m2\repository\commons-lang\commons-lang\2.5\commons-lang-2.5.jar;C:\Users\Aiops.m2\repository\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\Users\Aiops.m2\repository\net\sf\ezmorph\ezmorph\1.0.6\ezmorph-1.0.6.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.aiops.ShardingApplicationTests,contextLoads 09:55:02.463 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class com.aiops.ShardingApplicationTests] 09:55:02.471 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate] 09:55:02.483 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)] 09:55:02.508 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [com.aiops.ShardingApplicationTests] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper] 09:55:02.528 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.aiops.ShardingApplicationTests], using SpringBootContextLoader 09:55:02.534 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.aiops.ShardingApplicationTests]: class path resource [com/aiops/ShardingApplicationTests-context.xml] does not exist 09:55:02.535 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.aiops.ShardingApplicationTests]: class path resource [com/aiops/ShardingApplicationTestsContext.groovy] does not exist 09:55:02.535 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [com.aiops.ShardingApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}. 09:55:02.536 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.aiops.ShardingApplicationTests]: ShardingApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration. 09:55:02.619 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.aiops.ShardingApplicationTests] 09:55:02.808 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [D:\Java\workspace\Rui\shardingsphere-daemon\sharding_sublib_20210830\target\classes\com\aiops\ShardingApplication.class] 09:55:02.809 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration com.aiops.ShardingApplication for test class com.aiops.ShardingApplicationTests 09:55:03.101 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [com.aiops.ShardingApplicationTests]: using defaults. 09:55:03.102 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] 09:55:03.127 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@44ebcd03, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@694abbdc, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@2e005c4b, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@4567f35d, org.springframework.test.context.support.DirtiesContextTestExecutionListener@5ffead27, org.springframework.test.context.transaction.TransactionalTestExecutionListener@6356695f, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@4f18837a, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@359f7cdf] 09:55:03.130 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.aiops.ShardingApplicationTests] 09:55:03.135 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.aiops.ShardingApplicationTests] 09:55:03.153 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.aiops.ShardingApplicationTests] 09:55:03.153 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.aiops.ShardingApplicationTests] 09:55:03.155 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.aiops.ShardingApplicationTests] 09:55:03.155 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.aiops.ShardingApplicationTests] 09:55:03.156 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.aiops.ShardingApplicationTests] 09:55:03.157 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.aiops.ShardingApplicationTests] 09:55:03.166 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@7f3b84b8 testClass = ShardingApplicationTests, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@57a3af25 testClass = ShardingApplicationTests, locations = '{}', classes = '{class com.aiops.ShardingApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@5faeada1, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@1563da5, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@42f93a98, org.springframework.boot.test.web.reactive.server.WebTestClientContextCustomizer@32d2fa64], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true]], class annotated with @DirtiesContext [false] with mode [null]. 09:55:03.167 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.aiops.ShardingApplicationTests] 09:55:03.167 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.aiops.ShardingApplicationTests] 09:55:03.214 [main] DEBUG org.springframework.test.context.support.TestPropertySourceUtils - Adding inlined properties to environment: {spring.jmx.enabled=false, org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true, server.port=-1}

. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.1.7.RELEASE)

2021-09-27 09:55:03.832 INFO 2800 --- [ main] com.aiops.ShardingApplicationTests : Starting ShardingApplicationTests on DESKTOP-FKNI9S7 with PID 2800 (started by Aiops in D:\Java\workspace\Rui\shardingsphere-daemon\sharding_sublib_20210830) 2021-09-27 09:55:03.833 INFO 2800 --- [ main] com.aiops.ShardingApplicationTests : No active profile set, falling back to default profiles: default 2021-09-27 09:55:05.035 WARN 2800 --- [ main] o.m.s.mapper.ClassPathMapperScanner : Skipping MapperFactoryBean with name 'eamAlarmMapper' and 'com.aiops.mapper.EamAlarmMapper' mapperInterface. Bean already defined with the same name! 2021-09-27 09:55:05.035 WARN 2800 --- [ main] o.m.s.mapper.ClassPathMapperScanner : Skipping MapperFactoryBean with name 'ucEscalationEntityMapper' and 'com.aiops.mapper.UcEscalationEntityMapper' mapperInterface. Bean already defined with the same name! 2021-09-27 09:55:05.035 WARN 2800 --- [ main] o.m.s.mapper.ClassPathMapperScanner : No MyBatis mapper was found in '[com.aiops.mapper*]' package. Please check your configuration. 2021-09-27 09:55:05.280 INFO 2800 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode! 2021-09-27 09:55:05.284 INFO 2800 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode. 2021-09-27 09:55:05.348 INFO 2800 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 43ms. Found 0 repository interfaces. 2021-09-27 09:55:06.154 INFO 2800 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$aa6d83d5] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) Logging initialized using 'class org.apache.ibatis.logging.stdout.StdOutImpl' adapter. Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary. 2021-09-27 09:55:07.208 INFO 2800 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited 2021-09-27 09:55:07.419 INFO 2800 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-2} inited Registered plugin: 'com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor@e1e2e5e' Registered plugin: 'AbstractSqlParserHandler(sqlParserList=null, sqlParserFilter=null)' 2021-09-27 09:55:07.816 ERROR 2800 --- [ main] c.b.m.core.MybatisConfiguration : mapper[com.aiops.mapper.EamAlarmMapper.insertEamALarmNew] is ignored, because it exists, maybe from xml file Parsed mapper file: 'file [D:\Java\workspace\Rui\shardingsphere-daemon\sharding_sublib_20210830\target\classes\mapper\EamAlarmMapper.xml]' Parsed mapper file: 'file [D:\Java\workspace\Rui\shardingsphere-daemon\sharding_sublib20210830\target\classes\mapper\UcEscalationEntityMapper.xml]' | |_. __ | | | |\/|)(| | |\ |)|||_\ / |
3.1.2 2021-09-27 09:55:09.429 INFO 2800 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2021-09-27 09:55:12.049 INFO 2800 --- [ main] com.aiops.ShardingApplicationTests : Started ShardingApplicationTests in 8.82 seconds (JVM running for 10.518) Creating a new SqlSession SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7dbae40] was not registered for synchronization because synchronization is not active JDBC Connection [org.apache.shardingsphere.shardingjdbc.jdbc.core.connection.ShardingConnection@2f8c4fae] will not be managed by Spring ==> Preparing: INSERT INTO eam_alarm ( ID, VERSION_COL, USER ) VALUES ( ?, ?, ? ) ==> Parameters: 1442306801931747329(Long), 2(Long), 2(String) line 16:0 no viable alternative at input '(ID,VERSION_COL,USER' 2021-09-27 09:55:13.776 INFO 2800 --- [ main] ShardingSphere-SQL : Rule Type: sharding 2021-09-27 09:55:13.776 INFO 2800 --- [ main] ShardingSphere-SQL : Logic SQL: INSERT INTO eam_alarm ( ID, VERSION_COL,

USER ) VALUES ( ?, ?,

? ) 2021-09-27 09:55:13.776 INFO 2800 --- [ main] ShardingSphere-SQL : SQLStatement: InsertStatement(super=DMLStatement(super=AbstractSQLStatement(type=DML, tables=Tables(tables=[Table(name=eam_alarm, alias=Optional.absent())]), routeConditions=Conditions(orCondition=OrCondition(andConditions=[])), encryptConditions=Conditions(orCondition=OrCondition(andConditions=[])), sqlTokens=[TableToken(tableName=eam_alarm, quoteCharacter=NONE, schemaNameLength=0)], parametersIndex=0, logicSQL=INSERT INTO eam_alarm ( ID, VERSION_COL,

USER ) VALUES ( ?, ?,

? )), deleteStatement=false, updateTableAlias={}, updateColumnValues={}, whereStartIndex=0, whereStopIndex=0, whereParameterStartIndex=0, whereParameterEndIndex=0), columnNames=[], values=[]) 2021-09-27 09:55:13.776 INFO 2800 --- [ main] ShardingSphere-SQL : Actual SQL: ds1 ::: INSERT INTO eam_alarm ( ID, VERSION_COL,

USER ) VALUES ( ?, ?,

? ) ::: [1442306801931747329, 2, 2] 2021-09-27 09:55:13.776 INFO 2800 --- [ main] ShardingSphere-SQL : Actual SQL: ds2 ::: INSERT INTO eam_alarm ( ID, VERSION_COL,

USER ) VALUES ( ?, ?,

? ) ::: [1442306801931747329, 2, 2] <== Updates: 2 Time:808 ms - ID:com.aiops.mapper.EamAlarmMapper.insert Execute SQL:org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement@5b0902b4

Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7dbae40] 2021-09-27 09:55:13.928 INFO 2800 --- [ Thread-2] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 2021-09-27 09:55:13.934 INFO 2800 --- [ Thread-2] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed 2021-09-27 09:55:13.935 INFO 2800 --- [ Thread-2] com.alibaba.druid.pool.DruidDataSource : {dataSource-2} closed

Process finished with exit code 0

pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.7.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.aiops</groupId>
<artifactId>sharding</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>sharding</name>
<description>Demo project for Spring Boot</description>

<repositories>
    <repository>
        <id>nexus_public</id>
        <url>http://nexus.oneapm.me:8081/nexus/content/groups/public/</url>
    </repository>
</repositories>
<distributionManagement>
    <snapshotRepository>
        <id>local-snapshots</id>
        <uniqueVersion>false</uniqueVersion>
        <url>http://nexus.oneapm.me:8081/nexus/content/repositories/snapshots/</url>
        <layout>default</layout>
    </snapshotRepository>
    <repository>
        <id>local-releases</id>
        <uniqueVersion>true</uniqueVersion>
        <layout>default</layout>
        <url>http://nexus.oneapm.me:8081/nexus/content/repositories/releases/</url>
    </repository>
</distributionManagement>

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-redis</artifactId>
        <version>2.1.3.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-webflux</artifactId>
    </dependency>

    <!-- 使用数据源 -->
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid</artifactId>
        <version>1.1.6</version>
    </dependency>

    <!-- mysql -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.15</version>
    </dependency>

    <!--sharding jdbc springboot-->
    <dependency>
        <groupId>org.apache.shardingsphere</groupId>
        <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
        <version>4.0.0-RC1</version>
    </dependency>

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid-spring-boot-starter</artifactId>
        <version>1.1.14</version>
    </dependency>

    <!--集成mybatis -->
    <!-- 与数据库操作相关的依赖 -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>

    <!-- mybatisplus集成 -->
    <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-boot-starter</artifactId>
        <version>3.1.2</version>
    </dependency>
    <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus</artifactId>
        <version>3.1.2</version>
    </dependency>
    <!-- mybatisplus 代码生成器 -->
    <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-generator</artifactId>
        <version>3.1.2</version>
    </dependency>

    <!-- 模板引擎 -->
    <dependency>
        <groupId>org.apache.velocity</groupId>
        <artifactId>velocity-engine-core</artifactId>
        <version>2.0</version>
    </dependency>

    <!-- 模板引擎,需要指定 mpg.setTemplateEngine(new FreemarkerTemplateEngine()); -->
    <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>2.3.23</version>
    </dependency>

    <dependency>
        <groupId>com.mchange</groupId>
        <artifactId>c3p0</artifactId>
        <version>0.9.5.2</version>
    </dependency>

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>fastjson</artifactId>
        <version>1.2.58</version>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
    </dependency>

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5.9</version>
    </dependency>

    <!--junit-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-test</artifactId>
        <version>2.1.8.RELEASE</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>5.1.9.RELEASE</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>net.sf.json-lib</groupId>
        <artifactId>json-lib</artifactId>
        <version>2.4</version>
        <classifier>jdk15</classifier>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <fork>false</fork>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <mainClass>com.aiops.ShardingApplication</mainClass>
                        <classpathPrefix>dependency/</classpathPrefix>
                    </manifest>
                </archive>
            </configuration>
        </plugin>

    </plugins>

    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <includes>
                <include>application.properties</include>
                <include>**/*.xml</include>
            </includes>
            <filtering>true</filtering>
        </resource>
    </resources>
</build>

<!--<profiles>
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <profileActive>dev</profileActive>
        </properties>
    </profile>
    <profile>
        <id>test</id>
        <properties>
            <profileActive>test</profileActive>
        </properties>
    </profile>
    <profile>
        <id>prod</id>
        <properties>
            <profileActive>prod</profileActive>
        </properties>
    </profile>
</profiles>-->

jinghuaj commented 3 years ago

Problem has been solved ,cause by “USER” is database or frame work reserved word. how solve:alert column USER ---> USER1

jinghuaj commented 3 years ago

This is not a Sharding-JDBC bug