微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 H2 创建新数据库时 JRE 随机崩溃

如何解决使用 H2 创建新数据库时 JRE 随机崩溃

创建 (H2) 数据库时,我的应用程序在第一次启动时随机崩溃。

它崩溃了:

  • 在带有 jdk11 的 Windows 10 上“很多”
  • 在带有 jdk8 的 Windows 10 上“一点点”
  • 从来没有在 linux 上

我不知道为什么会发生这种崩溃,当然也不知道如何修复它。升级到最新的 jdk11 并不能解决任何问题,使用另一个版本的 openjdk(亚马逊、adoptopenjdk)也不能解决任何问题。

崩溃日志示例:

#
# A Fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000,pid=18092,tid=52220
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (11.0.8+10) (build 11.0.8+10)
# Java VM: OpenJDK Client VM AdoptOpenJDK (11.0.8+10,mixed mode,serial gc,windows-x86)
# Problxxxic frame:
# C  0x00000000
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report,please visit:
#   https://github.com/AdoptOpenJDK/openjdk-support/issues
#

---------------  S U M M A R Y ------------

Command Line: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -xms128M -Xmx512M -Dcom.sun.management.jmxremote -XX:+UnlockDiagnosticVMOptions -Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true --add-reads=java.xml=java.logging --add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED --patch-module=java.base=lib/endorsed/org.apache.karaf.specs.locator-4.2.9.jar --patch-module=java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-4.2.9.jar --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.naming/javax.naming.spi=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED -Dkaraf.instances=C:\DEV\RUN\distrib-xxx-3.0.0-SNAPSHOT\bin\..\instances -Dkaraf.home=C:\DEV\RUN\distrib-xxx-3.0.0-SNAPSHOT\bin\.. -Dkaraf.base=C:\DEV\RUN\distrib-xxx-3.0.0-SNAPSHOT\bin\.. -Dkaraf.etc=C:\DEV\RUN\distrib-xxx-3.0.0-SNAPSHOT\bin\..\etc -Dkaraf.log=C:\DEV\RUN\distrib-xxx-3.0.0-SNAPSHOT\bin\..\data\log -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=C:\DEV\RUN\distrib-xxx-3.0.0-SNAPSHOT\bin\..\data\tmp -Dkaraf.data=C:\DEV\RUN\distrib-xxx-3.0.0-SNAPSHOT\bin\..\data -Djava.util.logging.config.file=C:\DEV\RUN\distrib-xxx-3.0.0-SNAPSHOT\bin\..\etc\java.util.logging.properties org.apache.karaf.main.Main

Host: Intel(R) Core(TM) i7-9850H cpu @ 2.60GHz,12 cores,47G,Windows 10,64 bit Build 17763 (10.0.17763.1339)
Time: Fri Sep 11 16:06:48 2020 Paris,Madrid (heure d?�t�) elapsed time: 5 seconds (0d 0h 0m 5s)

---------------  T H R E A D  ---------------

Current thread (0x06c4d400):  JavaThread "Start Level: Equinox Container: 660fe646-fc21-4287-95c2-97d61c8330a6" daemon [_thread_in_vm,id=52220,stack(0x07470000,0x074c0000)]

Stack: [0x07470000,0x074c0000],sp=0x074baf4c,free space=299k
Java frames: (J=compiled Java code,j=interpreted,Vv=VM code)
j  org.h2.mvstore.FileStore.readFully(JI)Ljava/nio/ByteBuffer;+1
j  org.h2.mvstore.MVStore.readStoreHeader()V+14
j  org.h2.mvstore.MVStore.<init>(Ljava/util/Map;)V+663
j  org.h2.mvstore.MVStore$Builder.open()Lorg/h2/mvstore/MVStore;+8
j  org.h2.mvstore.db.MVTableEngine$Store.open(Lorg/h2/engine/Database;Lorg/h2/mvstore/MVStore$Builder;Z)V+7
j  org.h2.mvstore.db.MVTableEngine.init(Lorg/h2/engine/Database;)Lorg/h2/mvstore/db/MVTableEngine$Store;+231
j  org.h2.engine.Database.getPageStore()Lorg/h2/pagestore/PageStore;+19
j  org.h2.engine.Database.open(IILorg/h2/engine/ConnectionInfo;)V+627
j  org.h2.engine.Database.openDatabase(IIZLorg/h2/engine/ConnectionInfo;)V+5
j  org.h2.engine.Database.<init>(Lorg/h2/engine/ConnectionInfo;Ljava/lang/String;)V+698
j  org.h2.engine.Engine.openSession(Lorg/h2/engine/ConnectionInfo;ZZLjava/lang/String;)Lorg/h2/engine/Session;+145
j  org.h2.engine.Engine.openSession(Lorg/h2/engine/ConnectionInfo;)Lorg/h2/engine/Session;+54
j  org.h2.engine.Engine.createSessionAndValidate(Lorg/h2/engine/ConnectionInfo;)Lorg/h2/engine/Session;+2
j  org.h2.engine.Engine.createSession(Lorg/h2/engine/ConnectionInfo;)Lorg/h2/engine/Session;+4
j  org.h2.engine.Engine.createSession(Lorg/h2/engine/ConnectionInfo;)Lorg/h2/engine/SessionInterface;+2
j  org.h2.engine.SessionRemote.connectEmbeddedOrServer(Z)Lorg/h2/engine/SessionInterface;+98
j  org.h2.jdbc.JdbcConnection.<init>(Lorg/h2/engine/ConnectionInfo;Z)V+41
j  org.h2.jdbc.JdbcConnection.<init>(Ljava/lang/String;Ljava/util/Properties;)V+11
j  org.h2.Driver.connect(Ljava/lang/String;Ljava/util/Properties;)Ljava/sql/Connection;+59
j  com.zaxxer.hikari.util.DriverDataSource.getConnection()Ljava/sql/Connection;+12
j  com.zaxxer.hikari.pool.PoolBase.newConnection()Ljava/sql/Connection;+33
j  com.zaxxer.hikari.pool.PoolBase.newPoolEntry()Lcom/zaxxer/hikari/pool/PoolEntry;+5
j  com.zaxxer.hikari.pool.HikariPool.createPoolEntry()Lcom/zaxxer/hikari/pool/PoolEntry;+1
j  com.zaxxer.hikari.pool.HikariPool.checkFailFast()V+20
j  com.zaxxer.hikari.pool.HikariPool.<init>(Lcom/zaxxer/hikari/HikariConfig;)V+128
j  com.zaxxer.hikari.HikariDataSource.getConnection()Ljava/sql/Connection;+100

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。