You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "lefthand250 (via GitHub)" <gi...@apache.org> on 2023/04/19 05:50:46 UTC

[GitHub] [shardingsphere] lefthand250 opened a new issue, #25226: Hi, I have some question about ShardingSphere-JDBC

lefthand250 opened a new issue, #25226:
URL: https://github.com/apache/shardingsphere/issues/25226

   Hi, I have some question about ShardingSphere-JDBC
   this is my dependency
   ```
   <dependency>
   	    <groupId>org.apache.shardingsphere</groupId>
   	    <artifactId>shardingsphere-jdbc-core</artifactId>
   	    <version>5.3.0</version>
   	    
   	</dependency>
   	<!-- DataSource pool -->
   	<dependency>
           <groupId>com.alibaba</groupId>
           <artifactId>druid</artifactId>
           <version>1.1.23</version>
       </dependency>
       <!-- Overriding spring-start-web managed version 1.17 for snakeyaml-->
   	<dependency>
           <groupId>org.yaml</groupId>
           <artifactId>snakeyaml</artifactId>
           <version>1.33</version>
       </dependency>
   ```
   Here is my application.yml
   ```
   
   spring:
     application:
       name: hos-inventory
     datasource:
       driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
       url: jdbc:shardingsphere:classpath:datasource.yml
   ```
   Here is my datasources
   
   ```
   databaseName: ds_1
   mode:
     type: Standalone
     repository:
       type: JDBC
   dataSources:
     ds_1:
       dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
       username: ywt
       password: welcome1
       url: jdbc:mysql://192.168.1.110:3306/ywt159
      
   
   ```
   Here is the logs.
   Caused by: java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:h2:mem:config;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MYSQL
   at com.zaxxer.hikari.util.DriverDataSource.(DriverDataSource.java:88)
   at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:318)
   at com.zaxxer.hikari.pool.PoolBase.(PoolBase.java:108)
   at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:99)
   at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:94)
   at org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository.init(JDBCRepository.java:67)
   at org.apache.shardingsphere.infra.util.spi.type.required.RequiredSPIRegistry.getRegisteredService(RequiredSPIRegistry.java:45)
   at org.apache.shardingsphere.mode.repository.standalone.StandalonePersistRepositoryFactory.getInstance(StandalonePersistRepositoryFactory.java:44)
   at org.apache.shardingsphere.mode.manager.standalone.StandaloneContextManagerBuilder.build(StandaloneContextManagerBuilder.java:44)
   at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:76)
   at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.(ShardingSphereDataSource.java:64)
   at org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:93)
   at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:133)
   at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:75)
   at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.createDataSource(DriverDataSourceCache.java:51)
   at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
   at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.get(DriverDataSourceCache.java:45)
   at org.apache.shardingsphere.driver.ShardingSphereDriver.connect(ShardingSphereDriver.java:51)
   at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:319)
   ... 76 more
   Caused by: java.sql.SQLException: No suitable driver
   at java.sql.DriverManager.getDriver(DriverManager.java:315)
   at com.zaxxer.hikari.util.DriverDataSource.(DriverDataSource.java:81)
   
   It seems datasources doesn't work
   I don't know where is wrong.
   Can you please help me figure it out. I would be really grateful.


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

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

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


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #25226: Hi, I have some question about ShardingSphere-JDBC

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #25226:
URL: https://github.com/apache/shardingsphere/issues/25226#issuecomment-1516125848

   Upgrade your version to `5.3.2` and try it again?


-- 
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] freenet-233 commented on issue #25226: Hi, I have some question about ShardingSphere-JDBC

Posted by "freenet-233 (via GitHub)" <gi...@apache.org>.
freenet-233 commented on issue #25226:
URL: https://github.com/apache/shardingsphere/issues/25226#issuecomment-1567352302

   How do you solved this problem?Please tell 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] lefthand250 commented on issue #25226: Hi, I have some question about ShardingSphere-JDBC

Posted by "lefthand250 (via GitHub)" <gi...@apache.org>.
lefthand250 commented on issue #25226:
URL: https://github.com/apache/shardingsphere/issues/25226#issuecomment-1518916167

   > 
   
   Thanks,it solved my problem


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

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

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


[GitHub] [shardingsphere] lefthand250 closed issue #25226: Hi, I have some question about ShardingSphere-JDBC

Posted by "lefthand250 (via GitHub)" <gi...@apache.org>.
lefthand250 closed issue #25226: Hi, I have some question about ShardingSphere-JDBC
URL: https://github.com/apache/shardingsphere/issues/25226


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

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

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


[GitHub] [shardingsphere] RaigorJiang commented on issue #25226: Hi, I have some question about ShardingSphere-JDBC

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #25226:
URL: https://github.com/apache/shardingsphere/issues/25226#issuecomment-1514635291

   I think #23768 can make some help.


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