You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "huyu-tom (via GitHub)" <gi...@apache.org> on 2024/02/29 03:07:39 UTC
[I] JDBCRepositorySQLLoader native-image之后 loadFromDirectory方法,虽然进行了文件系统的创建,如果存在抛出java.nio.file.FileSystemAlreadyExistsException异常,没有考虑 [shardingsphere]
huyu-tom opened a new issue, #30344:
URL: https://github.com/apache/shardingsphere/issues/30344
sharding版本就是当前master的代码
错误堆栈照片:

错误堆栈:
Caused by: java.nio.file.FileSystemAlreadyExistsException: null
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystemProvider.newFileSystem(NativeImageResourceFileSystemProvider.java:115) ~[ai:na]
at java.base@21.0.2/java.nio.file.FileSystems.newFileSystem(FileSystems.java:339) ~[na:na]
at java.base@21.0.2/java.nio.file.FileSystems.newFileSystem(FileSystems.java:288) ~[na:na]
at org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader.loadFromDirectory(JDBCRepositorySQLLoader.java:116) ~[na:na]
at org.apache.shardingsphere.mode.repository.standalone.jdbc.sql.JDBCRepositorySQLLoader.load(JDBCRepositorySQLLoader.java:81) ~[na:na]
at org.apache.shardingsphere.mode.repository.standalone.jdbc.JDBCRepository.init(JDBCRepository.java:59) ~[ai:5.4.2-SNAPSHOT]
at org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader.findDefaultService(TypedSPILoader.java:73) ~[na:na]
at org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader.findService(TypedSPILoader.java:57) ~[na:na]
at org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader.getService(TypedSPILoader.java:110) ~[na:na]
at org.apache.shardingsphere.mode.manager.standalone.NewStandaloneContextManagerBuilder.build(NewStandaloneContextManagerBuilder.java:49) ~[ai:5.4.2-SNAPSHOT]
at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.createContextManager(ShardingSphereDataSource.java:78) ~[ai:5.4.2-SNAPSHOT]
at org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource.<init>(ShardingSphereDataSource.java:66) ~[ai:5.4.2-SNAPSHOT]
at org.apache.shardingsphere.driver.api.ShardingSphereDataSourceFactory.createDataSource(ShardingSphereDataSourceFactory.java:95) ~[ai:5.4.2-SNAPSHOT]
at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:135) ~[ai:5.4.2-SNAPSHOT]
at org.apache.shardingsphere.driver.api.yaml.YamlShardingSphereDataSourceFactory.createDataSource(YamlShardingSphereDataSourceFactory.java:70) ~[ai:5.4.2-SNAPSHOT]
at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.createDataSource(DriverDataSourceCache.java:55) ~[ai:5.4.2-SNAPSHOT]
at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.lambda$get$0(DriverDataSourceCache.java:48) ~[ai:5.4.2-SNAPSHOT]
at java.base@21.0.2/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[ai:na]
at org.apache.shardingsphere.driver.jdbc.core.driver.DriverDataSourceCache.get(DriverDataSourceCache.java:48) ~[ai:5.4.2-SNAPSHOT]
at org.apache.shardingsphere.driver.ShardingSphereDriver.connect(ShardingSphereDriver.java:53) ~[ai:5.4.2-SNAPSHOT]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) ~[ai:na]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:359) ~[ai:na]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:201) ~[ai:na]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:470) ~[ai:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[ai:na]
... 103 common frames omitted
这是我自己clone以下master的代码,进行的判断,它是成功的

成功的打印信息:
2024-02-29T10:56:24.891+08:00 INFO 8559 --- [ ] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2024-02-29T10:56:24.908+08:00 INFO 8559 --- [ ] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Starting...
2024-02-29T10:56:24.914+08:00 INFO 8559 --- [ ] com.zaxxer.hikari.pool.HikariPool : HikariPool-2 - Added connection conn0: url=jdbc:h2:mem:config user=SA
2024-02-29T10:56:24.914+08:00 INFO 8559 --- [ ] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Start completed.
2024-02-29T10:56:24.920+08:00 INFO 8559 --- [ ] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} inited
2024-02-29T10:56:33.231+08:00 INFO 8559 --- [ ] com.alibaba.druid.pool.DruidDataSource : {dataSource-2} inited
2024-02-29T10:56:39.004+08:00 INFO 8559 --- [ ] com.alibaba.druid.pool.DruidDataSource : {dataSource-3} inited
2024-02-29T10:56:41.545+08:00 INFO 8559 --- [ ] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Driver does not support get/set network timeout for connections. (getNetworkTimeout)
2024-02-29T10:56:41.545+08:00 INFO 8559 --- [ ] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection org.apache.shardingsphere.driver.jdbc.core.connection.ShardingSphereConnection@59ae1330
2024-02-29T10:56:41.545+08:00 INFO 8559 --- [ ] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2024-02-29T10:56:41.545+08:00 DEBUG 8559 --- [ ] c.h.m.product.ProductMapper.getList : ==> Preparing: select id,`number`,price,original_price,`desc`,create_time from product
2024-02-29T10:56:41.591+08:00 DEBUG 8559 --- [ ] c.h.m.product.ProductMapper.getList : ==> Parameters:
2024-02-29T10:56:41.592+08:00 INFO 8559 --- [ ] ShardingSphere-SQL : Logic SQL: select id,`number`,price,original_price,`desc`,create_time from product
2024-02-29T10:56:41.592+08:00 INFO 8559 --- [ ] ShardingSphere-SQL : Actual SQL: ai-slave1 ::: select id,`number`,price,original_price,`desc`,create_time from product
2024-02-29T10:56:41.650+08:00 DEBUG 8559 --- [ ] c.h.m.product.ProductMapper.getList : <== Total: 3
--
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
Re: [I] JDBCRepositorySQLLoader native-image之后 loadFromDirectory方法,虽然进行了文件系统的创建,如果存在抛出java.nio.file.FileSystemAlreadyExistsException异常,没有考虑 [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #30344: JDBCRepositorySQLLoader native-image之后 loadFromDirectory方法,虽然进行了文件系统的创建,如果存在抛出java.nio.file.FileSystemAlreadyExistsException异常,没有考虑
URL: https://github.com/apache/shardingsphere/issues/30344
--
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
Re: [I] JDBCRepositorySQLLoader native-image之后 loadFromDirectory方法,虽然进行了文件系统的创建,如果存在抛出java.nio.file.FileSystemAlreadyExistsException异常,没有考虑 [shardingsphere]
Posted by "huyu-tom (via GitHub)" <gi...@apache.org>.
huyu-tom commented on issue #30344:
URL: https://github.com/apache/shardingsphere/issues/30344#issuecomment-1972264466
> * 这确实是一个问题。`com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem`在某些Web框架中,在Web框架的生命周期中很长一段时间都会自动创建并启用相应的,因此这需要额外的判断。
> * 从 merge #30321 开始[,集成测试在 GraalVM Native Image ](https://github.com/apache/shardingsphere/issues/30345)[ #30345](https://github.com/apache/shardingsphere/issues/30345)上失败。[](https://github.com/apache/shardingsphere/issues/30345)
最新的代码不会出现之前的问题,可以构建成功
--
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
Re: [I] JDBCRepositorySQLLoader native-image之后 loadFromDirectory方法,虽然进行了文件系统的创建,如果存在抛出java.nio.file.FileSystemAlreadyExistsException异常,没有考虑 [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #30344:
URL: https://github.com/apache/shardingsphere/issues/30344#issuecomment-1970403646
- This is indeed a problem. In some web frameworks, the corresponding `com.oracle.svm.core.jdk.resources.NativeImageResourceFileSystem` is automatically created and enabled for a long time during the life cycle of the web framework, so this requires additional judgment.
- Handled with #30345.
--
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
Re: [I] JDBCRepositorySQLLoader native-image之后 loadFromDirectory方法,虽然进行了文件系统的创建,如果存在抛出java.nio.file.FileSystemAlreadyExistsException异常,没有考虑 [shardingsphere]
Posted by "huyu-tom (via GitHub)" <gi...@apache.org>.
huyu-tom commented on issue #30344:
URL: https://github.com/apache/shardingsphere/issues/30344#issuecomment-1972263380
> * 问题
最新的代码构建不会出现以上问题
--
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