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

时间:2018-10-04 17:10:43

标签: java spring spring-boot ignite

我使用的是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是否支持h2 DB(版本1.4.197),默认情况下在Spring-boot 2中提供

2 个答案:

答案 0 :(得分:5)

这是一个已知问题:

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'

答案 1 :(得分:0)

尝试一下:

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

将此内容放入pom文件中。 springboot 2.1.6.RELEASE的默认值为1.4.199,这会引起问题。