cd "/Applications/h2 1.3.167/bin"
java -cp h2-1.3.167.jar org.h2.tools.Server
2. Close the Java Preferences window.
3. Relaunch Java Preferences and see this:
Any and all help gratefully received, I'm getting pretty desperate here.
- I'm sorry, but can you please explain how to set a system property? I've googled java.net.preferIPv4Stack and all I see is Java code, calls to System.setProperty(). Also how do I get the current value of java.net.preferIPv4Stack -- perhaps it's already true???
- I've downloaded wireshark just now and I've got a capture of launching the console. There are 25 gaps of 3 or 4 seconds (mostly 3 seconds) between lines -- I've never done network analysis before so I don't know if this (3s / 4s) is a long time, I'm assuming Yes. I've saved the file so can send in the (assuming unlikely) event you want to see it. There's a huge number of things called "Standard query 0x0000 <hard disk name>.local, "QU" [or "QM"] question AAA <hard disk name>" and then the text goes off the screen and I haven't figured out a way to see the rest of it. Many of the 3s / 4s gaps are between lines like this.
On 17 December 2016 at 09:42, SkiAddict <skiad...@gmail.com> wrote:
- I'm sorry, but can you please explain how to set a system property? I've googled java.net.preferIPv4Stack and all I see is Java code, calls to System.setProperty(). Also how do I get the current value of java.net.preferIPv4Stack -- perhaps it's already true???add-Djava.net.preferIPv4Stack=trueto the h2.sh file after the "java" command
- I've downloaded wireshark just now and I've got a capture of launching the console. There are 25 gaps of 3 or 4 seconds (mostly 3 seconds) between lines -- I've never done network analysis before so I don't know if this (3s / 4s) is a long time, I'm assuming Yes. I've saved the file so can send in the (assuming unlikely) event you want to see it. There's a huge number of things called "Standard query 0x0000 <hard disk name>.local, "QU" [or "QM"] question AAA <hard disk name>" and then the text goes off the screen and I haven't figured out a way to see the rest of it. Many of the 3s / 4s gaps are between lines like this.you could post a screenshot here to look at
And I just noticed that you're running a really old version.You should probably try the latest 1.4 release, and add MV_STORE=false to your URL if you need to keep on using old databases.
Nice work so far, thanks.
2016-12-19 10:26:49
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode):
"Attach Listener" #18 daemon prio=9 os_prio=31 tid=0x00007fcc198f7000 nid=0xd813 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"H2 Console thread" #15 prio=5 os_prio=31 tid=0x00007fcc1a2ac800 nid=0x5a13 waiting for monitor entry [0x00007000013d8000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.net.InetAddress.getLocalHost(InetAddress.java:1486)
- waiting to lock <0x0000000795802000> (a java.lang.Object)
at org.h2.util.NetUtils.isLocalAddress(NetUtils.java:218)
at org.h2.server.web.WebThread.allow(WebThread.java:344)
at org.h2.server.web.WebThread.getAllowedFile(WebThread.java:74)
at org.h2.server.web.WebThread.process(WebThread.java:120)
at org.h2.server.web.WebThread.run(WebThread.java:89)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- None
"Java2D Disposer" #13 daemon prio=10 os_prio=31 tid=0x00007fcc19bd3800 nid=0xce1b in Object.wait() [0x00007000012d5000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000795b054e8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
- locked <0x0000000795b054e8> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
at sun.java2d.Disposer.run(Disposer.java:148)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- None
"Java2D Queue Flusher" #12 daemon prio=10 os_prio=31 tid=0x00007fcc1a1fd800 nid=0xc307 in Object.wait() [0x00007000011d2000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000795b02110> (a sun.java2d.opengl.OGLRenderQueue$QueueFlusher)
at sun.java2d.opengl.OGLRenderQueue$QueueFlusher.run(OGLRenderQueue.java:203)
- locked <0x0000000795b02110> (a sun.java2d.opengl.OGLRenderQueue$QueueFlusher)
Locked ownable synchronizers:
- None
"AWT-Shutdown" #11 prio=5 os_prio=31 tid=0x00007fcc19ad0000 nid=0x7417 in Object.wait() [0x000070000104c000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000795b5b708> (a java.lang.Object)
at java.lang.Object.wait(Object.java:502)
at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:295)
- locked <0x0000000795b5b708> (a java.lang.Object)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- None
"AppKit Thread" #10 daemon prio=5 os_prio=31 tid=0x00007fcc19948800 nid=0x200f runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"H2 Console Server (http://192.168.1.52:8082)" #8 prio=5 os_prio=31 tid=0x00007fcc1a0c4800 nid=0x100b runnable [0x000070000082b000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409)
at java.net.ServerSocket.implAccept(ServerSocket.java:545)
at java.net.ServerSocket.accept(ServerSocket.java:513)
at org.h2.server.web.WebServer.listen(WebServer.java:352)
at org.h2.tools.Server.run(Server.java:578)
at java.lang.Thread.run(Thread.java:745)
Locked ownable synchronizers:
- None
"Service Thread" #7 daemon prio=9 os_prio=31 tid=0x00007fcc1a05b000 nid=0x4403 runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"C1 CompilerThread1" #6 daemon prio=9 os_prio=31 tid=0x00007fcc19866800 nid=0x4203 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"C2 CompilerThread0" #5 daemon prio=9 os_prio=31 tid=0x00007fcc1983b800 nid=0x4003 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Signal Dispatcher" #4 daemon prio=9 os_prio=31 tid=0x00007fcc1983a800 nid=0x3e0f runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
Locked ownable synchronizers:
- None
"Finalizer" #3 daemon prio=8 os_prio=31 tid=0x00007fcc19821000 nid=0x2e03 in Object.wait() [0x0000700000728000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000795588ee0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
- locked <0x0000000795588ee0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)
Locked ownable synchronizers:
- None
"Reference Handler" #2 daemon prio=10 os_prio=31 tid=0x00007fcc1a01f000 nid=0x2c03 in Object.wait() [0x0000700000625000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x0000000795586b50> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:502)
at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
- locked <0x0000000795586b50> (a java.lang.ref.Reference$Lock)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)
Locked ownable synchronizers:
- None
"main" #1 prio=5 os_prio=31 tid=0x00007fcc1a005800 nid=0x907 runnable [0x0000700000219000]
java.lang.Thread.State: RUNNABLE
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
- locked <0x0000000795802000> (a java.lang.Object)
at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:271)
- locked <0x00000007957ff450> (a java.lang.Class for org.h2.util.NetUtils)
at org.h2.server.TcpServer.getURL(TcpServer.java:198)
at org.h2.tools.Server.start(Server.java:485)
at org.h2.tools.Console.runTool(Console.java:265)
at org.h2.tools.Console.main(Console.java:99)
Locked ownable synchronizers:
- None
"VM Thread" os_prio=31 tid=0x00007fcc1a005000 nid=0x2a03 runnable
"GC task thread#0 (ParallelGC)" os_prio=31 tid=0x00007fcc1a009800 nid=0x2603 runnable
"GC task thread#1 (ParallelGC)" os_prio=31 tid=0x00007fcc1a00a000 nid=0x2803 runnable
"VM Periodic Task Thread" os_prio=31 tid=0x00007fcc1986f800 nid=0x4603 waiting on condition
JNI global references: 418
127.0.0.1 localhost santas-macbook-pro-2.local
255.255.255.255 broadcasthost
::1 localhost santas-macbook-pro-2.local
fe80::1%lo0 localhost
Method called, hostname Santa's MacBook Pro.local, elapsed time: 5150 (ms)
I have seen slow local network connections from Java on other platforms, but with H2 it seems to be OSX or mac OS users who are running into it.
Similar problems have been discussed here last month: H2 database running really slow on mac OS sierra https://groups.google.com/d/msg/h2-database/H-oSOO7Lwn4/Pm5eY0WTBwAJ Although the problem got resolved by a simple addition to the hosts file, it is not quite clear what were all the things at play there and whether your situation is the same.
In your case, you may want to first try to set the local host name explicitly to something simple (no spaces, apostrophes or other non-traditional characters), rather than relying on your system to somehow automatically convert computer name to a legal network hostname. (The full computer name can be kept as is, for use in the UI).
127.0.0.1 localhost trial.local
255.255.255.255 broadcasthost
::1 localhost trial.local
fe80::1%lo0 localhost
I am not sure why you try to add "-2" at the end of the presumed hostname in your hosts file, the queries in your TCP captures do not show anything like that.
Finally, if you had no luck seeing any effect from modifications to /etc/hosts: on newer macs the file is apparently shadowed by /private/etc/hosts
I'm wondering if perhaps there is a gremlin in that string, since in stepping through the library code starting at InetAddress.getLocalHost().getHostName(), the only place it lags is a call to StringCoding.encode() from String.getBytes(), which wants to encode "Santa's MacBook Pro.local" in UTF-8. And it just so happens to lag for about 5s...
Also, this might be useful
sudo scutil --set HostName trial
I am very glad you persisted and found a simple solution. It may prove very useful to other Mac users whose system is in a similar configuration.
Regards,
Tomas