点燃不会从 spring-boot 2.0.5 开始 - h2 属性 NESTED_JOINS 不存在

Posted

技术标签:

【中文标题】点燃不会从 spring-boot 2.0.5 开始 - h2 属性 NESTED_JOINS 不存在【英文标题】:ignite won't start with spring-boot 2.0.5 - h2 property NESTED_JOINS doesn't exist 【发布时间】:2019-03-10 04:00:34 【问题描述】:

我使用的是 Ignite 2.6,它作为一个独立的 Java 应用程序运行良好,但它不适用于 Spring Boot。我收到此错误

  [20:44:18,520][SEVERE][exchange-worker-#37][GridDhtPartitionsExchangeFuture] Failed to reinitialize local partitions (preloading will be stopped): GridDhtPartitionExchangeId [topVer=AffinityTopologyVersion [topVer=8, minorTopVer=0], discoEvt=DiscoveryEvent [evtNode=TcpDiscoveryNode [id=ee3f7ea5-e448-4659-8148-232db27efde6, addrs=[0:0:0:0:0:0:0:1, 127.0.0.1, 192.168.0.52, 2406:7400:5c:13e0:44bc:65c7:241c:3804, 2406:7400:5c:13e0:d1cb:e1a9:15c5:c8ae], sockAddrs=[/2406:7400:5c:13e0:44bc:65c7:241c:3804:0, /0:0:0:0:0:0:0:1:0, /127.0.0.1:0, /192.168.0.52:0, /2406:7400:5c:13e0:d1cb:e1a9:15c5:c8ae:0], discPort=0, order=8, intOrder=0, lastExchangeTime=1538666050349, loc=true, ver=2.6.0#20180710-sha1:669feacc, isClient=true], topVer=8, nodeId8=ee3f7ea5, msg=null, type=NODE_JOINED, tstamp=1538666058292], nodeId=ee3f7ea5, evt=NODE_JOINED]
class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to initialize DB connection: jdbc:h2:mem:ee3f7ea5-e448-4659-8148-232db27efde6;LOCK_MODE=3;MULTI_THREADED=1;DB_CLOSE_ON_EXIT=FALSE;DEFAULT_LOCK_TIMEOUT=10000;FUNCTIONS_IN_SCHEMA=true;OPTIMIZE_REUSE_RESULTS=0;QUERY_CACHE_SIZE=0;RECOMPILE_ALWAYS=1;MAX_OPERATION_MEMORY=0;NESTED_JOINS=0;BATCH_JOINS=1;ROW_FACTORY="org.apache.ignite.internal.processors.query.h2.opt.GridH2PlainRowFactory";DEFAULT_TABLE_ENGINE=org.apache.ignite.internal.processors.query.h2.opt.GridH2DefaultTableEngine
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$1.initialValue(IgniteH2Indexing.java:330)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$1.initialValue(IgniteH2Indexing.java:298)
    at java.lang.ThreadLocal.setInitialValue(Unknown Source)
    at java.lang.ThreadLocal.get(Unknown Source)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$1.get(IgniteH2Indexing.java:300)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$1.get(IgniteH2Indexing.java:298)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.connectionForThread(IgniteH2Indexing.java:524)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.executeStatement(IgniteH2Indexing.java:592)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.createSchema(IgniteH2Indexing.java:561)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.registerCache(IgniteH2Indexing.java:2760)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.registerCache0(GridQueryProcessor.java:1594)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart0(GridQueryProcessor.java:799)
    at org.apache.ignite.internal.processors.query.GridQueryProcessor.onCacheStart(GridQueryProcessor.java:860)
    at org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCache(GridCacheProcessor.java:1212)
    at org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheStart(GridCacheProcessor.java:1964)
    at org.apache.ignite.internal.processors.cache.GridCacheProcessor.startCachesOnLocalJoin(GridCacheProcessor.java:1830)
    at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.initCachesOnLocalJoin(GridDhtPartitionsExchangeFuture.java:792)
    at org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsExchangeFuture.init(GridDhtPartitionsExchangeFuture.java:674)
    at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body0(GridCachePartitionExchangeManager.java:2419)
    at org.apache.ignite.internal.processors.cache.GridCachePartitionExchangeManager$ExchangeWorker.body(GridCachePartitionExchangeManager.java:2299)
    at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
    at java.lang.Thread.run(Unknown Source)
Caused by: org.h2.jdbc.JdbcSQLException: Unsupported connection setting "NESTED_JOINS" [90113-197]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
    at org.h2.message.DbException.get(DbException.java:179)
    at org.h2.message.DbException.get(DbException.java:155)
    at org.h2.engine.ConnectionInfo.readSettingsFromURL(ConnectionInfo.java:268)
    at org.h2.engine.ConnectionInfo.<init>(ConnectionInfo.java:76)
    at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:103)
    at org.h2.Driver.connect(Driver.java:69)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$1.initialValue(IgniteH2Indexing.java:327)
    ... 21 more

Ignite 2.6 是否支持在 spring-boot 2 中默认提供的 h2 DB(版本 1.4.197)

【问题讨论】:

【参考方案1】:

这是一个已知问题:

https://issues.apache.org/jira/browse/IGNITE-8197

Spring Boot 父 POM 文件指定 h2.version=1.4.197。我们已经能够通过在我们的 gradle 文件中强制降级 H2 来解决这个问题(我们使用的是 Spring Boot 2.0.2,fwiw):

ext['h2.version'] = '1.4.196'

【讨论】:

【参考方案2】:

试试这个:

<properties>
    <h2.version>1.4.197</h2.version>
</properties>

把它放在 pom 文件中。 springboot 2.1.6.RELEASE 的默认值为 1.4.199,这会导致问题。

【讨论】:

2021 年仍然是实际情况

以上是关于点燃不会从 spring-boot 2.0.5 开始 - h2 属性 NESTED_JOINS 不存在的主要内容,如果未能解决你的问题,请参考以下文章

Spring-Boot Banner

点燃了数字货币的Libra,为何落地依然阻力重重?

spring-boot 2.1.2.RELEASE bug

spring Kafka 模型不在受信任的包中

spring-boot mongodb 4.0 兼容性

springboot