자동 프로세스 모드에서 H2를 실행 중이므로 여러 프로세스에서 액세스 할 수 있습니다. 그러나 TOMEE가 이미 그것을 사용할 때 명령 행에서 org.h2.tools.Script를 실행할 수 없습니다. TOMEE를 종료하면 org.h2.tools.Script가 제대로 작동합니다. H2 : 여기 AUTOSERVER 모드에서 명령 줄에서 org.h2.tools.Script를 실행할 수 없습니다.
내가
자바 -cp h2-1.4.188.jar org.h2.tools.Script -url 'JDBC를 사용하고있는 commnad입니다 ~/테스트, FILE_LOCK = FILE, AUTO_SERVER = TRUE '-user SA -password 사 -script test.sql
예외 톰캣가
Exception in thread "main" org.h2.jdbc.JdbcSQLException: IO Exception: "java.io.FileNotFoundException: /var/lib/test.sql (Permission denied)"; SQL statement:
SCRIPT TO '/var/lib/test.sql' [90028-188]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:168)
at org.h2.message.DbException.convertIOException(DbException.java:328)
at org.h2.command.dml.ScriptBase.openOutput(ScriptBase.java:146)
at org.h2.command.dml.ScriptCommand.query(ScriptCommand.java:159)
at org.h2.command.CommandContainer.query(CommandContainer.java:90)
at org.h2.command.Command.executeQuery(Command.java:197)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:320)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:159)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: /var/lib/test.sql (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
at org.h2.store.fs.FilePathDisk.newOutputStream(FilePathDisk.java:290)
at org.h2.store.fs.FileUtils.newOutputStream(FileUtils.java:233)
at org.h2.command.dml.ScriptBase.openOutput(ScriptBase.java:144)
... 6 more
at org.h2.engine.SessionRemote.done(SessionRemote.java:624)
at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:158)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:179)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:158)
at org.h2.tools.Script.process(Script.java:141)
at org.h2.tools.Script.process(Script.java:120)
at org.h2.tools.Script.runTool(Script.java:101)
at org.h2.tools.Script.main(Script.java:46)
내가 FileNotFoundException이 볼 이유는 확실하지 않다 때 나는 명령을 실행했을 때 얻을. TOMEE가 실행되고 있지 않을 때 이것이 사라지는 것을 기억하십시오.
아이디어가 있으십니까? 나는 도커 컨테이너에있다. 나는 URL이 TOMEE와 Script 사이에서 일치하는지 확인했습니다.