lcjing commented on issue #31618:
URL:
https://github.com/apache/shardingsphere/issues/31618#issuecomment-2160424069
* I still don't understand why the design is like this, which means that the
`driverClassNam`e property I configured in `yaml` is not useful at all. The
detailed error log is as follows:
* in fact, the creation of the connection failed due to the
`driverClassName` being null
```properties
Caused by: java.lang.RuntimeException: java.sql.SQLException
at
org.apache.tomcat.jdbc.pool.DataSourceProxy.getWaitCount(DataSourceProxy.java:699)
at sun.reflect.GeneratedMethodAccessor293.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.apache.shardingsphere.infra.datasource.pool.creator.DataSourcePoolReflection.convertToProperties(DataSourcePoolReflection.java:94)
at
org.apache.shardingsphere.infra.datasource.pool.creator.DataSourcePoolReflection.convertToProperties(DataSourcePoolReflection.java:79)
at
org.apache.shardingsphere.infra.datasource.pool.props.creator.DataSourcePoolPropertiesCreator.createProperties(DataSourcePoolPropertiesCreator.java:90)
at
org.apache.shardingsphere.infra.datasource.pool.props.creator.DataSourcePoolPropertiesCreator.create(DataSourcePoolPropertiesCreator.java:65)
at
org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration.lambda$createDataSourcePoolPropertiesMap$2(DataSourceProvidedDatabaseConfiguration.java:81)
at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1321)
at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.util.Iterator.forEachRemaining(Iterator.java:116)
at
java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at
org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration.createDataSourcePoolPropertiesMap(DataSourceProvidedDatabaseConfiguration.java:81)
at
org.apache.shardingsphere.infra.config.database.impl.DataSourceProvidedDatabaseConfiguration.<init>(DataSourceProvidedDatabaseConfiguration.java:54)
at
org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:77)
at
org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.<init>(ShardingSphereDataSource.java:67)
at
org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:95)
at
org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:135)
at
org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:70)
at
org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.createDataSource(DriverDataSourceCache.java:55)
at
org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.lambda$get$0(DriverDataSourceCache.java:48)
at
java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at
org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.get(DriverDataSourceCache.java:48)
at
org.apache.shardingsphere.driver.ShardingSphereDriver.connect(ShardingSphereDriver.java:56)
at
org.springframework.jdbc.datasource.SimpleDriverDataSource.getConnectionFromDriver(SimpleDriverDataSource.java:140)
at
org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:196)
at
org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:159)
at
org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
at
org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
at
org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:81)
at
org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67)
at
org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:279)
at
org.apache.ibatis.executor.BatchExecutor.doQuery(BatchExecutor.java:84)
at
org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137)
at
org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:96)
at
org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:77)
at sun.reflect.GeneratedMethodAccessor295.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Invocation.proceed(Invocation.java:49)
at
com.pay1pay.framework.core.ibatis.PageHelper.intercept(PageHelper.java:92)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:60)
at com.sun.proxy.$Proxy51.query(Unknown Source)
at
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
... 48 common frames omitted
Caused by: java.sql.SQLException: null
at
org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:253)
at
org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:181)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:699)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:633)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:484)
at
org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:142)
at
org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:115)
at
org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:102)
at
org.apache.tomcat.jdbc.pool.DataSourceProxy.getWaitCount(DataSourceProxy.java:697)
... 98 common frames omitted
Caused by: java.lang.NullPointerException: null
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at
org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:245)
... 106 common frames omitted
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]