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 2020/10/06 04:55:40 UTC

[GitHub] [shardingsphere] gywndi opened a new issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

gywndi opened a new issue #7701:
URL: https://github.com/apache/shardingsphere/issues/7701


   ## Bug Report
   Hi, I'm updagraing ShardingSphere V3 to V4, but I've got some problem if I execute single jar file.
   ```bash
   java -jar target/my-tset-0.0.1-jar-with-dependencies.jar
   >>delete from uldra limit 10000
   >>java.lang.UnsupportedOperationException: Cannot support database type 'MySQL'
   ```
   You can see the delete query and result error above.
   
   ### Which version of ShardingSphere did you use?
   4.1.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-JDBC
   
   Maven project and you can see the pom.xml as below.
   I think, some resources are not included. And I had no problem if I use version 3.1.0.
   (In fact this error only happened if I execute with single jar file.)
   
   Is there anything I had missed?
   
   ```xml
   <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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   	<modelVersion>4.0.0</modelVersion>
   	<groupId>net.test</groupId>
   	<artifactId>my-test</artifactId>
   	<version>0.0.1</version>
   	<name>uldra-sphere</name>
   	<build>
   		<plugins>
   			<plugin>
   				<groupId>org.apache.maven.plugins</groupId>
   				<artifactId>maven-compiler-plugin</artifactId>
   				<version>3.6.1</version>
   				<configuration>
   					<source>1.8</source>
   					<target>1.8</target>
   				</configuration>
   			</plugin>
   			<plugin>
   				<artifactId>maven-assembly-plugin</artifactId>
   				<executions>
   					<execution>
   						<phase>package</phase>
   						<goals>
   							<goal>single</goal>
   						</goals>
   					</execution>
   				</executions>
   				<configuration>
   					<archive>
   						<manifest>
   							<mainClass>net.test.Main</mainClass>
   						</manifest>
   					</archive>
   					<descriptorRefs>
   						<descriptorRef>jar-with-dependencies</descriptorRef>
   					</descriptorRefs>
   				</configuration>
   			</plugin>
   		</plugins>
   	</build>
   
   	<dependencies>
   
   		<dependency>
   			<groupId>org.apache.shardingsphere</groupId>
   			<artifactId>sharding-jdbc-core</artifactId>
   			<version>4.1.1</version>
   		</dependency>
   
   		<dependency>
   			<groupId>org.apache.commons</groupId>
   			<artifactId>commons-dbcp2</artifactId>
   			<version>2.1</version>
   		</dependency>
   
   		<dependency>
   			<groupId>mysql</groupId>
   			<artifactId>mysql-connector-java</artifactId>
   			<version>5.1.48</version>
   		</dependency>
   
   	</dependencies>
   </project>
   ```
   


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

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



[GitHub] [shardingsphere] kimmking commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   Like @Lucas-307 wrote, maven-assembly plugin doesn't package all dependencies into your fat jar.


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

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



[GitHub] [shardingsphere] tristaZero commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   @lichaoshuai Hi, thanks for your sharing.


-- 
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] lichaoshuai commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   > > 
   > 
   > i want to know how solve this problem
   
   Warm up your service, but don't use multi thread.


-- 
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] gywndi closed issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   


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

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



[GitHub] [shardingsphere] wsYdd commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   @Minerva-Li 
   Config datasource and create ShardingDataSource , start Application meet this problem.
   ShardingSphere version is 4.1.1.
   
   `@Configuration
   public class MysqlDataSourceConfig {
   
       public static final String DATASOURCE_NAME = "DataSource";
   
       @Value("${mysql.datasource.url}")
       private String connUrl;
   
       @Value("${mysql.datasource.username}")
       private String connUser;
   
       @Value("${mysql.datasource.password}")
       private String connPassword;
   
       @Primary
       @Bean(name = DATASOURCE_NAME)
       public DataSource mysqlDataSource() throws SQLException {
           DruidDataSource dataSource = new DruidDataSource();
           dataSource.setUrl(connUrl);
           dataSource.setUsername(connUser);
           dataSource.setPassword(connPassword);
           dataSource.setDbType(DbType.mysql);
   
           // skip other config
   
           dataSource.init();
   
           Map<String, DataSource> dataSourceMap = new HashMap<>();
           dataSourceMap.put("ds", dataSource);
           TableRuleConfiguration tOrderConfiguration = new TableRuleConfiguration("t_order", "ds.t_order_${0..1}");
           tOrderConfiguration.setTableShardingStrategyConfig(new InlineShardingStrategyConfiguration("order_id", "t_order_${order_id % 2}"));
           KeyGeneratorConfiguration keyGeneratorConfiguration = new KeyGeneratorConfiguration("SNOWFLAKE", "order_id");
           tOrderConfiguration.setKeyGeneratorConfig(keyGeneratorConfiguration);
           ShardingRuleConfiguration shardingRuleConfiguration = new ShardingRuleConfiguration();
           shardingRuleConfiguration.getTableRuleConfigs().add(tOrderConfiguration);
   
           return ShardingDataSourceFactory.createDataSource(dataSourceMap, shardingRuleConfiguration, new Properties());
       }
   
       @Bean(name = "mysqlTransactionManager")
       public DataSourceTransactionManager mysqlTransactionManager() throws SQLException {
           return new DataSourceTransactionManager(mysqlDataSource());
       }
   
   }`
   
   Then  load before application start, it don't work.
   
   `
   @SpringBootApplication
   @EnableAsync
   @EnableScheduling
   @MapperScan(basePackages = {"XXXXXXX"})
   @EnableAutoConfiguration(exclude = {ElasticsearchAutoConfiguration.class, RestClientAutoConfiguration.class})
   public class StartEngine {
       public static void main(String[] args) {
           NewInstanceServiceLoader.register(SQLParserConfiguration.class);
           SpringApplication.run(StartEngine.class, args);
       }
   }`


-- 
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] Minerva-Li commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

Posted by GitBox <gi...@apache.org>.
Minerva-Li commented on issue #7701:
URL: https://github.com/apache/shardingsphere/issues/7701#issuecomment-1067783556


   > I use Springboot + mybatis + sharding-jdbc, Warm up service, but cannot solve this problem, anyone can help me
   
   Can you give more info  ? Code or project please ?  


-- 
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] Lucas-307 commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

Posted by GitBox <gi...@apache.org>.
Lucas-307 commented on issue #7701:
URL: https://github.com/apache/shardingsphere/issues/7701#issuecomment-706000458


   @gywndi 
   
   > java.lang.UnsupportedOperationException: Cannot support database type 'MySQL'
   
   Means can't find `shardingsphere-sql-parser-mysql-xxx.jar`. So, you should add it into your classpath.
   
   Such as: `java -cp bin/* -jar xxx.jar`


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

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



[GitHub] [shardingsphere] tristaZero commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   More detail of log is needed.
   The error came from `SQLParserConfigurationRegistry`
   ```Java
   public SQLParserConfiguration getSQLParserConfiguration(final String databaseTypeName) {
           if (configurations.containsKey(databaseTypeName)) {
               return configurations.get(databaseTypeName);
           }
           throw new UnsupportedOperationException(String.format("Cannot support database type '%s'", databaseTypeName));
       }
   ```


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

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



[GitHub] [shardingsphere] kimmking commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   Like @Lucas-307 wrote, maven-assembly plugin doesn't package all dependencies into your fat jar.


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

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



[GitHub] [shardingsphere] gywndi commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   I changed maven plugin from maven-assembling-plugin to maven-shade-plugin, and solved this problem.
   The pom file are as this. Thanks.
   ```
   <build>
   		<plugins>
   			<plugin>
   				<groupId>org.apache.maven.plugins</groupId>
   				<artifactId>maven-compiler-plugin</artifactId>
   				<version>3.6.1</version>
   				<configuration>
   					<source>1.8</source>
   					<target>1.8</target>
   				</configuration>
   			</plugin>
   
   			<plugin>
   				<groupId>org.apache.maven.plugins</groupId>
   				<artifactId>maven-shade-plugin</artifactId>
   				<version>3.2.2</version>
   				<executions>
   					<execution>
   						<phase>package</phase>
   						<goals>
   							<goal>shade</goal>
   						</goals>
   						<configuration>
   							<minimizeJar>false</minimizeJar>
   							<transformers>
   								<transformer
   									implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
   									<mainClass>net.test.Main</mainClass>
   								</transformer>
   								<transformer
   									implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
   									<resource>
   										META-INF/services/org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration
   									</resource>
   								</transformer>
   							</transformers>
   						</configuration>
   					</execution>
   				</executions>
   			</plugin>
   		</plugins>
   	</build>
   ```


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

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



[GitHub] [shardingsphere] Minerva-Li commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

Posted by GitBox <gi...@apache.org>.
Minerva-Li commented on issue #7701:
URL: https://github.com/apache/shardingsphere/issues/7701#issuecomment-1067997476


   >     dataSource.setDbType(DbType.mysql);
    What is DbType.mysql ?  
    
    Provide exception stack ? 


-- 
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] wsYdd edited a comment on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   @Minerva-Li 
   Config datasource and create ShardingDataSource , start Application meet this problem.
   ShardingSphere version is 4.1.1.
   
   `@Configuration
   public class MysqlDataSourceConfig {
   
       public static final String DATASOURCE_NAME = "DataSource";
   
       @Value("${mysql.datasource.url}")
       private String connUrl;
   
       @Value("${mysql.datasource.username}")
       private String connUser;
   
       @Value("${mysql.datasource.password}")
       private String connPassword;
   
       @Primary
       @Bean(name = DATASOURCE_NAME)
       public DataSource mysqlDataSource() throws SQLException {
           DruidDataSource dataSource = new DruidDataSource();
           dataSource.setUrl(connUrl);
           dataSource.setUsername(connUser);
           dataSource.setPassword(connPassword);
           dataSource.setDbType(DbType.mysql);
   
           // skip other config
   
           dataSource.init();
   
           Map<String, DataSource> dataSourceMap = new HashMap<>();
           dataSourceMap.put("ds", dataSource);
           TableRuleConfiguration tOrderConfiguration = new TableRuleConfiguration("t_order", "ds.t_order_${0..1}");
           tOrderConfiguration.setTableShardingStrategyConfig(new InlineShardingStrategyConfiguration("order_id", "t_order_${order_id % 2}"));
           KeyGeneratorConfiguration keyGeneratorConfiguration = new KeyGeneratorConfiguration("SNOWFLAKE", "order_id");
           tOrderConfiguration.setKeyGeneratorConfig(keyGeneratorConfiguration);
           ShardingRuleConfiguration shardingRuleConfiguration = new ShardingRuleConfiguration();
           shardingRuleConfiguration.getTableRuleConfigs().add(tOrderConfiguration);
   
           return ShardingDataSourceFactory.createDataSource(dataSourceMap, shardingRuleConfiguration, new Properties());
       }
   
       @Bean(name = "mysqlTransactionManager")
       public DataSourceTransactionManager mysqlTransactionManager() throws SQLException {
           return new DataSourceTransactionManager(mysqlDataSource());
       }
   
   }`
   
   Then  load before application start, it don't work.
   `
   #####
   @SpringBootApplication
   @EnableAsync
   @EnableScheduling
   @MapperScan(basePackages = {"XXXXXXX"})
   @EnableAutoConfiguration(exclude = {ElasticsearchAutoConfiguration.class, RestClientAutoConfiguration.class})
   public class StartEngine {
       public static void main(String[] args) {
           NewInstanceServiceLoader.register(SQLParserConfiguration.class);
           SpringApplication.run(StartEngine.class, args);
       }
   }`


-- 
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] wsYdd edited a comment on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   @Minerva-Li 
   Config datasource and create ShardingDataSource , start Application meet this problem.
   ShardingSphere version is 4.1.1.
   
   `@Configuration
   public class MysqlDataSourceConfig {
   
       public static final String DATASOURCE_NAME = "DataSource";
   
       @Value("${mysql.datasource.url}")
       private String connUrl;
   
       @Value("${mysql.datasource.username}")
       private String connUser;
   
       @Value("${mysql.datasource.password}")
       private String connPassword;
   
       @Primary
       @Bean(name = DATASOURCE_NAME)
       public DataSource mysqlDataSource() throws SQLException {
           DruidDataSource dataSource = new DruidDataSource();
           dataSource.setUrl(connUrl);
           dataSource.setUsername(connUser);
           dataSource.setPassword(connPassword);
           dataSource.setDbType(DbType.mysql);
   
           // skip other config
   
           dataSource.init();
   
           Map<String, DataSource> dataSourceMap = new HashMap<>();
           dataSourceMap.put("ds", dataSource);
           TableRuleConfiguration tOrderConfiguration = new TableRuleConfiguration("t_order", "ds.t_order_${0..1}");
           tOrderConfiguration.setTableShardingStrategyConfig(new InlineShardingStrategyConfiguration("order_id", "t_order_${order_id % 2}"));
           KeyGeneratorConfiguration keyGeneratorConfiguration = new KeyGeneratorConfiguration("SNOWFLAKE", "order_id");
           tOrderConfiguration.setKeyGeneratorConfig(keyGeneratorConfiguration);
           ShardingRuleConfiguration shardingRuleConfiguration = new ShardingRuleConfiguration();
           shardingRuleConfiguration.getTableRuleConfigs().add(tOrderConfiguration);
   
           return ShardingDataSourceFactory.createDataSource(dataSourceMap, shardingRuleConfiguration, new Properties());
       }
   
       @Bean(name = "mysqlTransactionManager")
       public DataSourceTransactionManager mysqlTransactionManager() throws SQLException {
           return new DataSourceTransactionManager(mysqlDataSource());
       }
   
   }`
   
   Then  load before application start, it don't work.
   `@SpringBootApplication
   @EnableAsync
   @EnableScheduling
   @MapperScan(basePackages = {"XXXXXXX"})
   @EnableAutoConfiguration(exclude = {ElasticsearchAutoConfiguration.class, RestClientAutoConfiguration.class})
   public class StartEngine {
       public static void main(String[] args) {
           NewInstanceServiceLoader.register(SQLParserConfiguration.class);
           SpringApplication.run(StartEngine.class, args);
       }
   }`


-- 
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] wsYdd commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   I use Springboot + mybatis + sharding-jdbc, Warm up service, but cannot solve this problem, anyone can help me


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] gywndi edited a comment on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   I changed maven plugin from maven-assembling-plugin to maven-shade-plugin, and solved this problem.
   The pom file are as this. Thanks.
   ```
   <build>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <version>3.6.1</version>
         <configuration>
           <source>1.8</source>
           <target>1.8</target>
         </configuration>
       </plugin>
   
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-shade-plugin</artifactId>
         <version>3.2.2</version>
         <executions>
           <execution>
             <phase>package</phase>
             <goals>
               <goal>shade</goal>
             </goals>
             <configuration>
               <minimizeJar>false</minimizeJar>
               <transformers>
                 <transformer
                   implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                   <mainClass>net.test.Main</mainClass>
                 </transformer>
                 <transformer
                   implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                   <resource>
                     META-INF/services/org.apache.shardingsphere.sql.parser.spi.SQLParserConfiguration
                   </resource>
                 </transformer>
               </transformers>
             </configuration>
           </execution>
         </executions>
       </plugin>
     </plugins>
   </build>
   ```


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

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



[GitHub] [shardingsphere] gywndi commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   Thanks for reply, but I still have same issue. :-(
   I checked my packaged jar with vi command, it's packaged shardingsphere-sql-parser-mysql-4.1.0.jar also.
   ```
   .. skip ..
   org/apache/shardingsphere/sql/parser/mysql/
   org/apache/shardingsphere/sql/parser/mysql/parser/
   org/apache/shardingsphere/sql/parser/mysql/visitor/
   org/apache/shardingsphere/sql/parser/mysql/visitor/impl/
   org/apache/shardingsphere/sql/parser/mysql/lexer/
   org/apache/shardingsphere/sql/parser/mysql/parser/MySQLParser.class
   org/apache/shardingsphere/sql/parser/mysql/MySQLParserConfiguration.class
   org/apache/shardingsphere/sql/parser/mysql/visitor/MySQLVisitorFacade.class
   org/apache/shardingsphere/sql/parser/mysql/visitor/MySQLVisitor.class
   org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDMLVisitor.class
   org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLRLVisitor.class
   org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDDLVisitor.class
   org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDALVisitor.class
   org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDCLVisitor.class
   org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLTCLVisitor.class
   org/apache/shardingsphere/sql/parser/mysql/lexer/MySQLLexer.class
   org/apache/shardingsphere/sql/parser/autogen/MySQLStatementParser$DropColumnSpecificationContext.class
   org/apache/shardingsphere/sql/parser/autogen/MySQLStatementParser$ShowProcesslistContext.class
   .. skip ..
   ```
   
   There's no problem, if I execute with java command as below.
   ```bash
   java -classpath my-test-0.0.1-jar-with-dependencies.jar:shardingsphere-sql-parser-mysql-4 net.test.Main
   ```
   
   But I changed execute `-jar` as below, I have same problem.
   ```bash
   java -classpath my-test-0.0.1-jar-with-dependencies.jar:shardingsphere-sql-parser-mysql-4.1.0.jar -jar my-test-0.0.1-jar-with-dependencies.jar
   ```
   
   Could it be caused by the class not loading? If so, is there a way to force loading?


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

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



[GitHub] [shardingsphere] tristaZero commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   More detail of log is needed.
   The error came from `SQLParserConfigurationRegistry`
   ```Java
   public SQLParserConfiguration getSQLParserConfiguration(final String databaseTypeName) {
           if (configurations.containsKey(databaseTypeName)) {
               return configurations.get(databaseTypeName);
           }
           throw new UnsupportedOperationException(String.format("Cannot support database type '%s'", databaseTypeName));
       }
   ```


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

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



[GitHub] [shardingsphere] lichaoshuai commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   When use  fork/join or  parallelstream at the first time of service running , it may cause error for spi can not load. 
   
   remove it and solved . 


-- 
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] Lucas-307 commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

Posted by GitBox <gi...@apache.org>.
Lucas-307 commented on issue #7701:
URL: https://github.com/apache/shardingsphere/issues/7701#issuecomment-706000458


   @gywndi 
   
   > java.lang.UnsupportedOperationException: Cannot support database type 'MySQL'
   
   Means can't find `shardingsphere-sql-parser-mysql-xxx.jar`. So, you should add it into your classpath.
   
   Such as: `java -cp bin/* -jar xxx.jar`


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

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



[GitHub] [shardingsphere] wsYdd edited a comment on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   @Minerva-Li 
   Config datasource and create ShardingDataSource , start Application meet this problem.
   ShardingSphere version is 4.1.1.
   
   `@Configuration
   public class MysqlDataSourceConfig {
   
       public static final String DATASOURCE_NAME = "DataSource";
   
       @Value("${mysql.datasource.url}")
       private String connUrl;
   
       @Value("${mysql.datasource.username}")
       private String connUser;
   
       @Value("${mysql.datasource.password}")
       private String connPassword;
   
       @Primary
       @Bean(name = DATASOURCE_NAME)
       public DataSource mysqlDataSource() throws SQLException {
           DruidDataSource dataSource = new DruidDataSource();
           dataSource.setUrl(connUrl);
           dataSource.setUsername(connUser);
           dataSource.setPassword(connPassword);
           dataSource.setDbType(DbType.mysql);
   
           // skip other config
   
           dataSource.init();
   
           Map<String, DataSource> dataSourceMap = new HashMap<>();
           dataSourceMap.put("ds", dataSource);
           TableRuleConfiguration tOrderConfiguration = new TableRuleConfiguration("t_order", "ds.t_order_${0..1}");
           tOrderConfiguration.setTableShardingStrategyConfig(new InlineShardingStrategyConfiguration("order_id", "t_order_${order_id % 2}"));
           KeyGeneratorConfiguration keyGeneratorConfiguration = new KeyGeneratorConfiguration("SNOWFLAKE", "order_id");
           tOrderConfiguration.setKeyGeneratorConfig(keyGeneratorConfiguration);
           ShardingRuleConfiguration shardingRuleConfiguration = new ShardingRuleConfiguration();
           shardingRuleConfiguration.getTableRuleConfigs().add(tOrderConfiguration);
   
           return ShardingDataSourceFactory.createDataSource(dataSourceMap, shardingRuleConfiguration, new Properties());
       }
   
       @Bean(name = "mysqlTransactionManager")
       public DataSourceTransactionManager mysqlTransactionManager() throws SQLException {
           return new DataSourceTransactionManager(mysqlDataSource());
       }
   
   }`
   
   Then  load before application start, it don't work.
   
   `@SpringBootApplication
   @EnableAsync
   @EnableScheduling
   @MapperScan(basePackages = {"XXXXXXX"})
   @EnableAutoConfiguration(exclude = {ElasticsearchAutoConfiguration.class, RestClientAutoConfiguration.class})
   public class StartEngine {
       public static void main(String[] args) {
           NewInstanceServiceLoader.register(SQLParserConfiguration.class);
           SpringApplication.run(StartEngine.class, args);
       }
   }`


-- 
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] lebron374 commented on issue #7701: java.lang.UnsupportedOperationException: Cannot support database type 'MySQL' error

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


   > 
   
   i want to know how solve this problem


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

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