installing h2 as a service on a server

343 views
Skip to first unread message

Sander

unread,
Mar 22, 2007, 10:35:50 PM3/22/07
to H2 Database
Hello Thomas,

H2 on a server without X11 gives the following message:

h2@ubuntu:~/h2/bin$ java -jar h2.jar -tcp -web
systray4j: no systray4j in java.library.path
Exception in thread "main" java.lang.InternalError: Can't connect to
X11 window server using '' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access
$100(X11GraphicsEnvironment.java:52)
at sun.awt.X11GraphicsEnvironment
$1.run(X11GraphicsEnvironment.java:155)
at java.security.AccessController.doPrivileged(Native Method)
at
sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:
131)

---

I still believe it is working because Lynx on localhost:8082 gives the
message:

Welcome to H2

No Javascript

If you are not automatically redirected to the login page, then
Javascript is currently disabled or your browser does not support
Javascript. For this application to work, Javascript is essential.
Please enable Javascript now, or use another web browser that
supports
it.

Best regards,
Sander

Sander

unread,
Mar 22, 2007, 10:51:51 PM3/22/07
to H2 Database
Hmmm maybe this isn't really an issue:

h2@ubuntu:~/h2/bin$ java -cp h2.jar org.h2.tools.Server
TCP server running on tcp://localhost:9092 (only local connections)
ODBC server running on tcp://localhost:9083 (only local connections)
Web server running on http://localhost:8082 (only local connections)
Please open a browser and go to http://localhost:8082

Calling the Server class itself works perfectly...

Best regards :-)
Sander

Sander

unread,
Mar 22, 2007, 11:12:15 PM3/22/07
to H2 Database
However i have trouble shutting down the tcp service:

h2@ubuntu:~$ cat ./startup.sh
java org.h2.tools.Server -tcp
h2@ubuntu:~$ ./startup.sh &
[1] 8396
h2@ubuntu:~$ TCP server running on tcp://localhost:9092 (only local
connections)

h2@ubuntu:~$ cat ./shutdown.sh
java org.h2.tools.Server -tcpShutdown localhost
h2@ubuntu:~$ ./shutdown.sh
Shutting down TCP Server at localhost
Exception in thread "main" org.h2.jdbc.JdbcSQLException: Function
STOP_SERVER not found; SQL statement: CALL STOP_SERVER(?, ?, ?)
[90022-44]
at org.h2.message.Message.addSQL(Message.java:348)
at org.h2.command.Parser.parse(Parser.java:226)
at org.h2.command.Parser.prepareCommand(Parser.java:191)
at org.h2.engine.Session.prepareLocal(Session.java:174)
at org.h2.engine.Session.prepareCommand(Session.java:156)
at
org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:993)
at
org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:
1197)
at
org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:167)
at org.h2.tools.Server.shutdownTcpServer(Server.java:249)
at org.h2.tools.Server.run(Server.java:163)
at org.h2.tools.Server.main(Server.java:110)
[...]

Best regards!
Sander

Thomas Mueller

unread,
Mar 23, 2007, 11:18:16 PM3/23/07
to h2-da...@googlegroups.com
Hi,

Thanks for your help! If there is more stack trace, could you post it
as well? It would help solve the problem. About Lynx: do you want to
use Lynx with it? If yes then a non-frame, non Javascript version of
the H2 Console would be required.

Thomas

Sander

unread,
Mar 24, 2007, 7:46:00 AM3/24/07
to H2 Database
Hello Thomas,

Thank you for the excellent H2 database :-)
It would be nice if you could open a command line console to the
database (instead of Lynx).
But it is not really that important, but it would also be nice for
scripting SQL.
Maybe extract data for a backup etc.

The complete stacktrace for the shutdown is:

h2@ubuntu:~$ Shutting down TCP Server at localhost


Exception in thread "main" org.h2.jdbc.JdbcSQLException: Function
STOP_SERVER not found; SQL statement: CALL STOP_SERVER(?, ?, ?)
[90022-44]
at org.h2.message.Message.addSQL(Message.java:348)
at org.h2.command.Parser.parse(Parser.java:226)
at org.h2.command.Parser.prepareCommand(Parser.java:191)
at org.h2.engine.Session.prepareLocal(Session.java:174)
at org.h2.engine.Session.prepareCommand(Session.java:156)
at
org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:993)
at
org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:
1197)
at
org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:167)
at org.h2.tools.Server.shutdownTcpServer(Server.java:249)
at org.h2.tools.Server.run(Server.java:163)
at org.h2.tools.Server.main(Server.java:110)
org.h2.jdbc.JdbcSQLException: Function STOP_SERVER not found

[90022-44]
at org.h2.message.Message.getSQLException(Message.java:65)
at org.h2.message.Message.getSQLException(Message.java:47)
at org.h2.command.Parser.readJavaFunction(Parser.java:1573)
at org.h2.command.Parser.readFunction(Parser.java:1595)
at org.h2.command.Parser.readTerm(Parser.java:1802)
at org.h2.command.Parser.readFactor(Parser.java:1508)
at org.h2.command.Parser.readSum(Parser.java:1495)
at org.h2.command.Parser.readConcat(Parser.java:1487)
at org.h2.command.Parser.readCondition(Parser.java:1368)
at org.h2.command.Parser.readAnd(Parser.java:1349)
at org.h2.command.Parser.readExpression(Parser.java:1341)
at org.h2.command.Parser.parserCall(Parser.java:2992)
at org.h2.command.Parser.parse(Parser.java:276)
at org.h2.command.Parser.parse(Parser.java:220)


at org.h2.command.Parser.prepareCommand(Parser.java:191)
at org.h2.engine.Session.prepareLocal(Session.java:174)
at org.h2.engine.Session.prepareCommand(Session.java:156)
at
org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:993)
at
org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:
1197)
at
org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:167)
at org.h2.tools.Server.shutdownTcpServer(Server.java:249)
at org.h2.tools.Server.run(Server.java:163)
at org.h2.tools.Server.main(Server.java:110)

Hope this helps!

Best regards,
Sander

Thomas Mueller

unread,
Mar 30, 2007, 9:41:26 PM3/30/07
to h2-da...@googlegroups.com
Hi,
Sorry for the delay. I have tested it now, and it works for me.
However the Shutdown URL is different:

java org.h2.tools.Server -tcp
java org.h2.tools.Server -tcpShutdown tcp://localhost:9092

Maybe this is the problem?
Thomas

Sander

unread,
Mar 31, 2007, 2:16:54 PM3/31/07
to H2 Database
Hello Thomas,
That fixed my problem indeed!
Thanks :-)

Reply all
Reply to author
Forward
0 new messages