After some investigation, it comes out that it's the similar problem like 
https://github.com/plasma-umass/doppio/issues/497

the jdk10 compiled class not compact with jdk8. 
    Caused by: java.lang.NoSuchMethodError: java.nio.ByteBuffer.rewind()
Ljava/nio/ByteBuffer;

public final class DataUtils {
public static void readFully(FileChannel file, long pos, ByteBuffer dst) {
            ...
            dst.rewind();
            ...
}

the db file locked, 
the rewind() failed, 
the database object is not put into named map, so later, it will created 
again because not in the map.
the db file is going to be locked again and failed.

So the solution I suggest is,  upgrade jdk to 10+ when the 
java.nio.Buffer's method is called on it's sub-classes. 



On Thursday, January 10, 2019 at 5:54:43 PM UTC+8, neoe wrote:
>
> java -cp h2.jar org.h2.tools.Server -tcp &
>
> java -cp h2.jar org.h2.tools.Shell -url "jdbc:h2:tcp://127.0.0.1/./xxxxx" 
>  -driver org.h2.Driver
>
> Exception in thread "main" org.h2.jdbc.
> JdbcSQLNonTransientConnectionException: Database may be already in use: 
> null. Possible solutions: close all other connection(s); use the server 
> mode [90020-197]
>         at org.h2.message.DbException.getJdbcSQLException(DbException.java
> :616)
>         at org.h2.message.DbException.getJdbcSQLException(DbException.java
> :427)
>         at org.h2.message.DbException.get(DbException.java:194)
>         at org.h2.mvstore.db.MVTableEngine$Store.
> convertIllegalStateException(MVTableEngine.java:193)
>         at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:
> 173)
>         at org.h2.mvstore.db.MVTableEngine.init(MVTableEngine.java:95)
>         at org.h2.engine.Database.getPageStore(Database.java:2712)
>         at org.h2.engine.Database.open(Database.java:768)
>         at org.h2.engine.Database.openDatabase(Database.java:319)
>         at org.h2.engine.Database.<init>(Database.java:313)
>         at org.h2.engine.Engine.openSession(Engine.java:69)
>         at org.h2.engine.Engine.openSession(Engine.java:201)
>         at org.h2.engine.Engine.createSessionAndValidate(Engine.java:178)
>         at org.h2.engine.Engine.createSession(Engine.java:161)
>         at org.h2.server.TcpServerThread.run(TcpServerThread.java:160)
>         at java.lang.Thread.run(Thread.java:748)
> Caused by: java.lang.IllegalStateException: The file is locked: nio:/path/
> xxxxx.mv.db [1.4.197/7]
>         at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.
> java:884)
>         at org.h2.mvstore.FileStore.open(FileStore.java:166)
>         at org.h2.mvstore.MVStore.<init>(MVStore.java:388)
>         at org.h2.mvstore.MVStore$Builder.open(MVStore.java:3331)
>         at org.h2.mvstore.db.MVTableEngine$Store.open(MVTableEngine.java:
> 162)
>         ... 11 more
> Caused by: java.nio.channels.OverlappingFileLockException
>         at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255
> )
>         at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
>         at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1113)
>         at org.h2.store.fs.FileNio.tryLock(FilePathNio.java:121)
>         at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155)
>         at org.h2.mvstore.FileStore.open(FileStore.java:163)
>         ... 14 more
>
>         at org.h2.message.DbException.getJdbcSQLException(DbException.java
> :616)
>         at org.h2.engine.SessionRemote.done(SessionRemote.java:607)
>         at org.h2.engine.SessionRemote.initTransfer(SessionRemote.java:143
> )
>         at org.h2.engine.SessionRemote.connectServer(SessionRemote.java:
> 431)
>         at org.h2.engine.SessionRemote.connectEmbeddedOrServer(
> SessionRemote.java:317)
>         at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:124)
>         at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:103)
>         at org.h2.Driver.connect(Driver.java:69)
>         at java.sql.DriverManager.getConnection(DriverManager.java:664)
>         at java.sql.DriverManager.getConnection(DriverManager.java:247)
>         at org.h2.tools.Shell.runTool(Shell.java:147)
>         at org.h2.tools.Shell.main(Shell.java:80)
> It seems that failed to use github newest code to open old .mv.db?
> any workaround ?
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to