Open ronin0079 opened 2 years ago
重启lealone再执行,就成这样了。
Exception in thread "main" org.lealone.common.exceptions.JdbcSQLException: Connection is broken: "org.lealone.common.exceptions.DbException: General error: ""java.lang.IllegalStateException: Reading from cache:nio:E:/2021-9/demo/target/data/db_2/t_2_0/3.db failed; file length 0 read length 8192 at 0 [5.0.0/1]"" [50000-0]: localhost" [90067-0]
at org.lealone.common.exceptions.DbException.getJdbcSQLException(DbException.java:340)
at org.lealone.common.exceptions.DbException.get(DbException.java:161)
at org.lealone.client.session.ClientSessionFactory.lambda$createSession$0(ClientSessionFactory.java:84)
at org.lealone.db.async.AsyncCallback.setAsyncResult(AsyncCallback.java:157)
at org.lealone.client.session.ClientSessionFactory.lambda$createClientSession$2(ClientSessionFactory.java:134)
at org.lealone.db.async.AsyncCallback.setAsyncResult(AsyncCallback.java:157)
at org.lealone.db.async.AsyncCallback.setAsyncResult(AsyncCallback.java:144)
at org.lealone.net.TcpClientConnection.handleResponse(TcpClientConnection.java:130)
at org.lealone.net.TransferConnection.handle(TransferConnection.java:123)
at org.lealone.net.nio.NioEventLoop.read(NioEventLoop.java:208)
at org.lealone.net.nio.NioEventLoopClient.run(NioEventLoopClient.java:74)
at org.lealone.net.nio.NioEventLoopClient.lambda$createNioEventLoop$0(NioEventLoopClient.java:46)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.lealone.common.exceptions.DbException: General error: "java.lang.IllegalStateException: Reading from cache:nio:E:/2021-9/demo/target/data/db_2/t_2_0/3.db failed; file length 0 read length 8192 at 0 [5.0.0/1]" [50000-0]
at org.lealone.common.exceptions.DbException.convert(DbException.java:280)
at org.lealone.net.TransferConnection.parseError(TransferConnection.java:76)
at org.lealone.net.TcpClientConnection.handleResponse(TcpClientConnection.java:101)
... 5 more
Caused by: org.lealone.common.exceptions.JdbcSQLException: General error: "java.lang.IllegalStateException: Reading from cache:nio:E:/2021-9/demo/target/data/db_2/t_2_0/3.db failed; file length 0 read length 8192 at 0 [5.0.0/1]" [50000-0]
at org.lealone.common.exceptions.DbException.getJdbcSQLException(DbException.java:340)
at org.lealone.common.exceptions.DbException.get(DbException.java:161)
at org.lealone.common.exceptions.DbException.convert(DbException.java:292)
at org.lealone.db.Database.openDatabase(Database.java:512)
at org.lealone.db.Database.init(Database.java:422)
at org.lealone.db.session.ServerSessionFactory.createServerSession(ServerSessionFactory.java:83)
at org.lealone.db.session.ServerSessionFactory.createServerSession(ServerSessionFactory.java:48)
at org.lealone.db.session.ServerSessionFactory.createSession(ServerSessionFactory.java:39)
at org.lealone.db.session.SessionFactory.createSession(SessionFactory.java:26)
at org.lealone.db.ConnectionInfo.createSession(ConnectionInfo.java:619)
at org.lealone.server.TcpServerConnection.createSession(TcpServerConnection.java:117)
at org.lealone.server.TcpServerConnection.readInitPacket(TcpServerConnection.java:99)
at org.lealone.server.TcpServerConnection.handleRequest(TcpServerConnection.java:70)
at org.lealone.net.TransferConnection.handle(TransferConnection.java:120)
at org.lealone.net.nio.NioEventLoop.read(NioEventLoop.java:208)
at org.lealone.server.Scheduler.handleSelectedKeys(Scheduler.java:426)
at org.lealone.server.Scheduler.doAwait(Scheduler.java:404)
at org.lealone.server.Scheduler.executeNextStatement(Scheduler.java:242)
at org.lealone.server.Scheduler.run(Scheduler.java:100)
Caused by: java.lang.IllegalStateException: Reading from cache:nio:E:/2021-9/demo/target/data/db_2/t_2_0/3.db failed; file length 0 read length 8192 at 0 [5.0.0/1]
at org.lealone.common.util.DataUtils.newIllegalStateException(DataUtils.java:613)
at org.lealone.common.util.DataUtils.readFully(DataUtils.java:389)
at org.lealone.storage.fs.FileStorage.readFully(FileStorage.java:574)
at org.lealone.storage.aose.btree.BTreeStorage.readChunkHeader(BTreeStorage.java:162)
at org.lealone.storage.aose.btree.BTreeStorage.access$1000(BTreeStorage.java:44)
at org.lealone.storage.aose.btree.BTreeStorage$ChunkMetaData.readLastChunk(BTreeStorage.java:602)
at org.lealone.storage.aose.btree.BTreeStorage$ChunkMetaData.
at org.lealone.net.TransferConnection.parseError(TransferConnection.java:66)
... 6 more
感谢报告问题,正在排查原因。
不drop database,只执行服务创建脚本services.sql,重复三次就会报错
Exception in thread "main" org.lealone.common.exceptions.JdbcSQLException: General error: "java.lang.ClassCastException: class org.lealone.transaction.aote.TransactionalValue cannot be cast to class org.lealone.db.index.standard.VersionedValue (org.lealone.transaction.aote.TransactionalValue and org.lealone.db.index.standard.VersionedValue are in unnamed module of loader 'app')"; SQL statement: RUNSCRIPT FROM 'demo-service/src/main/resources/services.sql' [50000-0] at org.lealone.common.exceptions.DbException.getJdbcSQLException(DbException.java:340) at org.lealone.common.exceptions.DbException.get(DbException.java:161) at org.lealone.common.exceptions.DbException.convert(DbException.java:292) at org.lealone.sql.executor.YieldableBase.handleException(YieldableBase.java:162) at org.lealone.sql.executor.YieldableBase.run(YieldableBase.java:115) at org.lealone.db.session.ServerSession$YieldableCommand.run(ServerSession.java:1501) at org.lealone.server.Scheduler.executeNextStatement(Scheduler.java:247) at org.lealone.server.Scheduler.run(Scheduler.java:100) Caused by: java.lang.ClassCastException: class org.lealone.transaction.aote.TransactionalValue cannot be cast to class org.lealone.db.index.standard.VersionedValue (org.lealone.transaction.aote.TransactionalValue and org.lealone.db.index.standard.VersionedValue are in unnamed module of loader 'app') at org.lealone.db.index.standard.StandardPrimaryIndex$StandardPrimaryIndexCursor.createRow(StandardPrimaryIndex.java:558) at org.lealone.db.index.standard.StandardPrimaryIndex$StandardPrimaryIndexCursor.next(StandardPrimaryIndex.java:548) at org.lealone.db.Database.findMeta(Database.java:757) at org.lealone.db.Database.tryRemoveMeta(Database.java:795) at org.lealone.db.Database.tryRemoveMeta(Database.java:779) at org.lealone.db.schema.Schema.remove(Schema.java:258) at org.lealone.sql.ddl.DropService.update(DropService.java:61) at org.lealone.sql.dml.RunScript.execute(RunScript.java:87) at org.lealone.sql.dml.RunScript.update(RunScript.java:66) at org.lealone.sql.executor.DefaultYieldableLocalUpdate.executeInternal(DefaultYieldableLocalUpdate.java:22) at org.lealone.sql.executor.YieldableBase.run(YieldableBase.java:109) ... 3 more