I have a few questions.
> When I run h2.bat with no arguments, the H2 Console window pops up in
> a browser, but it says, "Sorry, remote connections ('webAllowOthers')
> are disabled on this server". Subsequent attempts to run h2.bat fail
> by telling me that port 8082 is already in use, and I need to find and
> kill the java process in task manager to free up the port.
On my machine, a small (AWT-) window appears with the title "H2
Console", the URL (http://localhost:8082 in my case), and a button
'Start Browser'. Does this window appear for you as well? What Java
version and operating system do you use?
Does it say anything on the command line after you started it? For me,
it does not. To what URL does the browser (try to) connect? For me
it's http://localhost:8082.
> I don't think I've had to specify -webAllowOthers in earlier
> releases. Is that the intended behavior?
It should only be required if you want to access the H2 Console from
another machine (this is disabled by default for security reasons).
Regards,
Thomas
There was a change in the last release "The server tool now displays
the correct IP address if networked." This was changed to support
AUTO_SERVER mode, but also (I believe) it's nice to get the 'real' IP
address and not just 'localhost'. I can reproduce the problem now by
doing this:
- connect to a LAN (I get the IP address 10.0.x.x)
- start the H2 Console (this works so far)
- enable the WLAN (I get a second IP address: 10.10.x.x)
- open the URL http://10.0.x.x...
A workaround is to use 'localhost' to connect. I found a fix:
NetUtils.isLoopbackAddress(Socket socket) throws UnknownHostException {
InetAddress test = socket.getInetAddress();
boolean result = true;
//## Java 1.4 begin ##
result = test.isLoopbackAddress();
if (result) {
return result;
}
//## Java 1.4 end ##
InetAddress localhost = InetAddress.getLocalHost();
InetAddress[] list =
InetAddress.getAllByName(localhost.getCanonicalHostName());
for (int i = 0; i < list.length; i++) {
InetAddress addr = list[i];
if (test.equals(addr)) {
return true;
}
}
return false;
}
If you have time, could you test if this works for you? This shouldn't
ever throw an exception (but it's better to log them, just in case).
This will be included in the next release. The release notes will be:
"Connections from a local address other than 'localhost' were not
allowed if remote connections were disabled. This was always a
problem, but only got visible in the last release because the server
no longer connects to 'localhost' if networked."
Regards,
Thomas