Hi,

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


On Wed, Oct 1, 2008 at 11:48 PM, maxhearn <[EMAIL PROTECTED]> wrote:
>
> I think this answers everything you asked:
>
> 1) Just as a sanity check, I've tried flipping back and forth between
> version .77 and .79.  I definitely don't see the problem with .77, but
> I do see it with .79.
>
> 2) I've tried this with several Java versions:  1.6.12 and 1.5.4.  I
> get the same results each time.
>
> 3) I'm running on Windows XP.
>
> 4) In .77:  I get the H2 Console window (AWT).  The URL is 
> http://localhost:8082.
> Then I get the browser window, connecting to 
> http://localhost:8082/login.jsp?jsessionid=xxx
> .  And the contents give me a login screen.  In the DOS command
> window, it says nothing on the command line after H2.
>
> 5) In .79:  I get the H2 Console window (AWT).  The URL is
> http://144.xxx.xxx.xxx:8082.  Then I get the browser window,
> connecting to http://144.xxx.xxx.xxx:8082/ .  And the contents say H2
> Console.  Sorry, remote connections ('webAllowOthers') are disabled on
> this server.  In the DOS command window, it says nothing on the
> command line after H2.  (Oh, and closing the H2 AWT window is
> sufficient to allow me to try to connect again - I was wrong about
> needing to kill the process in task manager.)
>
> 6) So, as you surmised, it doesn't think it is attempting to make a
> local connection in version .79.
>
>
> On Oct 1, 1:32 pm, "Thomas Mueller" <[EMAIL PROTECTED]>
> wrote:
>> Hi,
>>
>> 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:8082in 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'shttp://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
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to