Error running H2 server on OS X

646 views
Skip to first unread message

Tobi Schäfer

unread,
Jul 4, 2011, 7:00:30 PM7/4/11
to h2-da...@googlegroups.com
Hi there

Lately, I am getting the following error when trying to run the H2 database server on Mac OS X 10.6.8:

$ java -cp Downloads/h2-1.3.157.jar org.h2.tools.Server -trace
java.net.ConnectException: Cannot allocate memory
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
at java.net.Socket.connect(Socket.java:529)
at org.h2.util.NetUtils.createSocket(NetUtils.java:110)
at org.h2.util.NetUtils.createSocket(NetUtils.java:91)
at org.h2.util.NetUtils.createLoopbackSocket(NetUtils.java:49)
at org.h2.server.web.WebServer.isRunning(WebServer.java:354)
at org.h2.tools.Server.isRunning(Server.java:415)
at org.h2.tools.Server.start(Server.java:374)
at org.h2.tools.Server.runTool(Server.java:215)
at org.h2.tools.Server.main(Server.java:115)
The Web Console server could not be started. Possible cause: another server is already running at http://192.168.2.1:8082
Exception in thread "main" org.h2.jdbc.JdbcSQLException: Exception opening port "H2 Console Server (http://192.168.2.1:8082)" (port may be in use), cause: "timeout" [90061-157]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.tools.Server.start(Server.java:377)
at org.h2.tools.Server.runTool(Server.java:215)
at org.h2.tools.Server.main(Server.java:115)

There is nothing else running on port 8082:

$ nc -vz localhost 8082
nc: connect to localhost port 8081 (tcp) failed: Connection refused
nc: connect to localhost port 8081 (tcp) failed: Connection refused
nc: connect to localhost port 8081 (tcp) failed: Connection refused

Strange enough I get the same error when testing the port with the IP address:

$ nc -vz 192.168.2.1 8082
nc: connect to 192.168.2.1 port 8082 (tcp) failed: Cannot allocate memory

The binary tries to open the H2 console in the browser at http://192.168.2.1:8082 – but this results in an error page because no connection can be made.

Furthermore, the yellow icon in the menu bar is missing.

Although I can display the console using http://localhost:8082 I still cannot connect to a database at jdbc:h2:tcp://localhost/~/path/to/data;ifexists=true because that gives me another error:


Trying to connect to jdbc:h2:tcp://192.168.2.1/~/path/to/data;ifexists=true again returns


Would be glad about any help because I am really stuck. I cannot remember having this problem ever before. 

Oh, and the last thing I did concerning Java is install Apple’s recent Update. Could this be related? How could I revert to the previous version, anyway?

$ java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode)

Cheers,
tobi

Thomas Mueller

unread,
Jul 5, 2011, 12:02:21 AM7/5/11
to h2-database

Tobi Schäfer

unread,
Jul 5, 2011, 12:43:19 PM7/5/11
to h2-da...@googlegroups.com
(Sorry if this message won’t be posted under the correct thread at https://groups.google.com/d/topic/h2-database/aSHOcBY1SAk/discussion – I was not able to post using the Google Groups web interface because “An error (#316) occurred while communicating with the server.”)

Thanks for the pointers, Thomas.

Forgot to mention that I already tried steps 1 and 2 of the appletoolbox.com fix without luck.

Anyway, I found the cause for the error myself: Internet Sharing!

After turning it off the error disappeared and everything is working fine now.

Tobi

PGP.sig
Reply all
Reply to author
Forward
0 new messages