首页 > 解决方案 > 使用 Java 15 启用持久性的 Apache Ignite 服务器节点(2.9.1)抛出异常

问题描述

例外:

[15:30:27,658][SEVERE][main][IgniteKernal] Exception during start processors, node will be stopped and close connections
java.lang.NullPointerException: Cannot invoke "java.lang.reflect.Method.invoke(Object, Object[])" because "org.apache.ignite.internal.processors.cache.persistence.wal.filehandle.FileWriteHandleImpl.mappingOffset" is null
    at org.apache.ignite.internal.processors.cache.persistence.wal.filehandle.FileWriteHandleImpl.fsync(FileWriteHandleImpl.java:450)
    at org.apache.ignite.internal.processors.cache.persistence.wal.filehandle.FileWriteHandleImpl.fsync(FileWriteHandleImpl.java:419)
    at org.apache.ignite.internal.processors.cache.persistence.wal.filehandle.FileHandleManagerImpl.flush(FileHandleManagerImpl.java:270)
    at org.apache.ignite.internal.processors.cache.persistence.wal.FileWriteAheadLogManager.flush(FileWriteAheadLogManager.java:905)
    at org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.tailPointer(GridCacheDatabaseSharedManager.java:2159)
    at org.apache.ignite.internal.processors.cache.persistence.GridCacheDatabaseSharedManager.startMemoryRestore(GridCacheDatabaseSharedManager.java:2087)
    at org.apache.ignite.internal.IgniteKernal.start(IgniteKernal.java:1257)
    at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start0(IgnitionEx.java:2052)
    at org.apache.ignite.internal.IgnitionEx$IgniteNamedInstance.start(IgnitionEx.java:1698)
    at org.apache.ignite.internal.IgnitionEx.start0(IgnitionEx.java:1114)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:634)
    at org.apache.ignite.internal.IgnitionEx.start(IgnitionEx.java:560)
    at org.apache.ignite.Ignition.start(Ignition.java:328)

点燃配置:

  public static IgniteConfiguration createConfiguration() {
    
    IgniteConfiguration cfg = new IgniteConfiguration();

    // Enabling peer-class loading feature.
    cfg.setPeerClassLoadingEnabled(true);

    DataStorageConfiguration dataStorageCfg = new DataStorageConfiguration();
    // Setting Persistence Enabled true
    dataStorageCfg.getDefaultDataRegionConfiguration().setPersistenceEnabled(true);
    cfg.setDataStorageConfiguration(dataStorageCfg);
    
    return cfg;
    
  }

尽管与 Java 8 和 11 相同的配置运行良好。

Java 15 中的PersistenceEnabled(false)也没有问题

标签: javaspringspring-bootignitegridgain

解决方案


Ignite 仅在 Java 的 LTS 版本(即 Java 8 和 11)上进行了真正的测试。我会坚持使用这些版本。


推荐阅读