1.4.201-pre fails on valid connection string on Windows General error: "java.nio.file.InvalidPathException: Illegal char <:> at index 3

100 views
Skip to first unread message

areichel

unread,
Nov 22, 2019, 3:34:40 AM11/22/19
to H2 Database
Dear All,

on Windows Server 2000, the following connection strings works well with 1.4.200 (and previous versions):

jdbc:h2:tcp://localhost//C:/Users/manticore/.manticore/ifrsbox;PAGE_SIZE=8192;CACHE_SIZE=200000;AUTO_RECONNECT=TRUE;DB_CLOSE_DELAY=60;DB_CLOSE_ON_EXIT=FALSE;DEFRAG_ALWAYS=true;LOCK_TIMEOUT=10000

It fails with 1.4.201-pre (pulled today) with the following exception:

General error: "java.nio.file.InvalidPathException: Illegal char <:> at index 3: mem:management_db_9092.h2.db" [50000-200]  Illegal char <:> at index 3: mem:management _db_9092.h2.db

Bug or feature? And how am I supposed to point on Windows paths now?
Best regards
Andreas

areichel

unread,
Nov 22, 2019, 3:43:22 AM11/22/19
to H2 Database
Also, starting up the server standalone fails:

C:\Users\manticore\Documents\vbox>java -jar  dist\lib\h2.jar

TCP server running at tcp://132.10.200.124:9092 (only local connections)
Root cause: General error: "java.nio.file.InvalidPathException: Illegal char <:>
 at index 3: mem:management_db_9092.h2.db" [50000-200]
Exception in thread "main" org.h2.jdbc.JdbcSQLNonTransientException: General err
or: "java.nio.file.InvalidPathException: Illegal char <:> at index 3: mem:manage
ment_db_9092.h2.db" [50000-200]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:505)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
        at org.h2.message.DbException.get(DbException.java:194)
        at org.h2.message.DbException.convert(DbException.java:347)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.jav
a:342)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:173)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:152)
        at org.h2.Driver.connect(Driver.java:69)
        at org.h2.server.TcpServer.initManagementDb(TcpServer.java:96)
        at org.h2.server.TcpServer.start(TcpServer.java:254)
        at org.h2.tools.Server.start(Server.java:511)
        at org.h2.tools.Console.runTool(Console.java:233)
        at org.h2.tools.Console.main(Console.java:72)
Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 3: mem:
management_db_9092.h2.db
        at sun.nio.fs.WindowsPathParser.normalize(Unknown Source)
        at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
        at sun.nio.fs.WindowsPathParser.parse(Unknown Source)
        at sun.nio.fs.WindowsPath.parse(Unknown Source)
        at sun.nio.fs.WindowsFileSystem.getPath(Unknown Source)
        at java.nio.file.Paths.get(Unknown Source)
        at org.h2.store.fs.FilePathDisk.exists(FilePathDisk.java:188)
        at org.h2.store.fs.FileUtils.exists(FileUtils.java:69)
        at org.h2.engine.Database.exists(Database.java:485)
        at org.h2.engine.Engine.openSession(Engine.java:64)
        at org.h2.engine.Engine.openSession(Engine.java:192)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:171)
        at org.h2.engine.Engine.createSession(Engine.java:166)
        at org.h2.engine.Engine.createSession(Engine.java:29)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.jav
a:340)
        ... 8 more

C:\Users\manticore\Documents\vbox>

Evgenij Ryazanov

unread,
Nov 22, 2019, 3:44:18 AM11/22/19
to H2 Database
Hello.

It looks like a bug. Thanks for the report!

Evgenij Ryazanov

unread,
Nov 22, 2019, 5:46:17 AM11/22/19
to H2 Database
Your issue should be fixed in the current master branch. Please, fetch the latest sources and re-test it.

areichel

unread,
Nov 25, 2019, 5:27:29 AM11/25/19
to H2 Database
Well, there is an improvement:

1) I can start H2 in server mode (java -jar h2.jar)

2) shortened connection string works, e.g.

jdbc:h2:tcp://localhost/~/.manticore/ifrsbox

3) absolute connection string still fails, e.g.

jdbc:h2:tcp://localhost//C:/Users/manticore/.manticore/ifrsbox   (it is valid and works with 1.4.200)

General error: "java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/manticore/.manticore/ifrsbox" [50000-200] HY000/50000 (Help)
org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Users/manticore/.manticore/ifrsbox" [50000-200]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:505)
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:429)
    at org.h2.message.DbException.get(DbException.java:194)
    at org.h2.message.DbException.convert(DbException.java:347)
    at org.h2.server.TcpServerThread.sendError(TcpServerThread.java:234)
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:178) 

Evgenij Ryazanov

unread,
Nov 25, 2019, 5:59:58 AM11/25/19
to H2 Database
jdbc:h2:tcp://localhost//C:/Users/… is obliviously invalid, did you try jdbc:h2:tcp://localhost/C:/Users/… with one slash after localhost?

areichel

unread,
Nov 25, 2019, 6:08:46 AM11/25/19
to H2 Database
You have a point:
jdbc:h2:tcp://localhost/C:/Users/manticore/.manticore/ifrsbox works with 1.4.201pre

Thank you for your help and advice.
Cheers!
Reply all
Reply to author
Forward
0 new messages