H2DB created on Linux fails to open on Mac

214 views
Skip to first unread message

jason herman

unread,
Nov 20, 2014, 4:31:54 PM11/20/14
to h2-da...@googlegroups.com
Hi all,

Here is what i'm doing:
a) create an H2 Database using the R package RH2 on Ubuntu & verify it works.
b) put all database files into a tar archive, send to a Mac machine & expand archive 
c) attempts to connect get the following error:

Connecting to H2 DATABASE using url 'jdbc:h2:file:/dat/MYDB;FILE_LOCK=SOCKET;AUTO_SERVER=TRUE;TRACE_LEVEL_FILE=3'

Error in is(object, Cl) : 
  error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': Error in .jcall(.rJava.class.loader, "V", "addClassPath", as.character(path)) : 
  org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: localhost:52634" [90067-175]


This same process worked just a few days ago. Nothing that I can think of has changed.

Any thoughts?

thanks, jason

Thomas Mueller

unread,
Nov 24, 2014, 12:20:04 PM11/24/14
to h2-da...@googlegroups.com
Hi,

The error "Connection refused" when using "localhost" usually means there either is a firewall that prevents the connection, or there is something wrong with the file /etc/hosts.

Regards,
Thomas

--
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 h2-database...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

jason herman

unread,
Nov 30, 2014, 1:35:21 PM11/30/14
to h2-da...@googlegroups.com
thanks for replying.

i turned off the firewall and got the same result, so eliminating that possibility.

I am not sure how /etc/hosts comes in to play when using a db url such as "jdbc:h2:file:/dat/...". But I checked it and it looks fine. On this mac it contains:

127.0.0.1 localhost

255.255.255.255 broadcasthost

::1             localhost 


thanks, jason


On Monday, November 24, 2014 12:20:04 PM UTC-5, Thomas Mueller wrote:
Hi,

The error "Connection refused" when using "localhost" usually means there either is a firewall that prevents the connection, or there is something wrong with the file /etc/hosts.

Regards,
Thomas



On Thursday, November 20, 2014, jason herman <jasonb...@gmail.com> wrote:
Hi all,

Here is what i'm doing:
a) create an H2 Database using the R package RH2 on Ubuntu & verify it works.
b) put all database files into a tar archive, send to a Mac machine & expand archive 
c) attempts to connect get the following error:

Connecting to H2 DATABASE using url 'jdbc:h2:file:/dat/MYDB;FILE_LOCK=SOCKET;AUTO_SERVER=TRUE;TRACE_LEVEL_FILE=3'

Error in is(object, Cl) : 
  error in evaluating the argument 'drv' in selecting a method for function 'dbConnect': Error in .jcall(.rJava.class.loader, "V", "addClassPath", as.character(path)) : 
  org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: localhost:52634" [90067-175]


This same process worked just a few days ago. Nothing that I can think of has changed.

Any thoughts?

thanks, jason

--
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 h2-database+unsubscribe@googlegroups.com.

Thomas Mueller

unread,
Dec 1, 2014, 1:50:56 AM12/1/14
to h2-da...@googlegroups.com
Hi,

You have used the auto-server mode, so there is a TCP/IP connection between the client and the application that opened the database first. See the documentation for details.

The /etc/hosts file looks OK; I'm afraid I don't know what the problem could be. Could you verify the following please? Open the file <databaseName>.lock.db and post the content. If it's empty, try opening the database and check the contents again. For me, the file contains:

#FileLock
#Mon Dec 01 07:21:03 CET 2014
id=14a04826acafc4674cbb7e941f122c8f13500e8e27f
method=file
server=localhost\:64729

Now try on the command line:

telnet localhost 52634 (in your case)
telnet localhost 64729 (in my case)

I can connect if the database is open, and can not (connection refused) if it is not open. Now, try deleting the file <databaseName>.lock.db and check if it is automatically re-created.

Regards,
Thomas

To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages