Discussion:
[jetty-users] UPDATE: calling setHost under jetty v9.4.8.v20171121 causes embeded jetty application to hang
west suhanic
2017-12-12 19:08:10 UTC
Permalink
Hello:

This is an update to my previous email.

If I use an actual IP address in the setHost call everything works as
expected.

For example:

ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(http_config));
http.setPort(8080);
http.setHost( "192.168.20.9" );
http.setIdleTimeout(30000);

works as expected when contacted using the following URL:

http://aaa.bbb.ccc:8080/index.html


thank you,

west suhanic
Greg Wilkins
2017-12-12 19:25:46 UTC
Permalink
West,

Sounds like there could be some DNS resolution problems on your machine.

Can you do a host lookup for "aaa,bbb.ccc" and get 192.168.20.9? from the
command line?
Perhaps try writing a little test main in java to check that InetAddress
can also look up the name and resolve it.

regards
Post by west suhanic
This is an update to my previous email.
If I use an actual IP address in the setHost call everything works as
expected.
ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(http_config));
http.setPort(8080);
http.setHost( "192.168.20.9" );
http.setIdleTimeout(30000);
http://aaa.bbb.ccc:8080/index.html
thank you,
west suhanic
_______________________________________________
jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
--
Greg Wilkins <***@webtide.com> CTO http://webtide.com
west suhanic
2017-12-12 20:23:17 UTC
Permalink
Hi Greg:

Thanks for the reply.

I can indeed ping the machine aaa.bbb.ccc from the client machine and get
the expected IP address of 192.168.20.9.
I did write a small piece of code which populates an array of InetAddress.
The first element in the array
contains 127.0.0.1 and the second contains 192.168.20.9. My /etc/hosts
file is configured this way
because of another application. So the work around I have is to populate
InetAddress array and use the non-local
host IP address in the setHost call. This solves my problem and maintains
my non-standard configuration.

thanks,

west suhanic
Post by Greg Wilkins
West,
Sounds like there could be some DNS resolution problems on your machine.
Can you do a host lookup for "aaa,bbb.ccc" and get 192.168.20.9? from the
command line?
Perhaps try writing a little test main in java to check that InetAddress
can also look up the name and resolve it.
regards
Post by west suhanic
This is an update to my previous email.
If I use an actual IP address in the setHost call everything works as
expected.
ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(http_config));
http.setPort(8080);
http.setHost( "192.168.20.9" );
http.setIdleTimeout(30000);
http://aaa.bbb.ccc:8080/index.html
thank you,
west suhanic
_______________________________________________
jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
--
west suhanic
2017-12-13 21:32:31 UTC
Permalink
Hi Greg:

I said yesterday that I had a fix. Well after more testing my fix of using
an IP address
with the setHost call did not solve the problem. It led to more problems.
The problems
were only resolved when I either do not call setHost or call it with a null
parameter; i.e., setHost( null ).

My code base has been running smoothly with setHost( hostName ) where
hostname is the fully qualified domain name
for several years against Jetty v9.2.1.x and most recently Jetty
v9.4.1.v20170120. The problems arose when I
upgraded to Jetty v9.4.7.v20170914 and Jetty 9.4.8.v20171121 .

I am using jetty with jdk-8u152 running under gentoo on an X86-64 PC.

My network setup is fine with the machine being accessible to all machines
on my internal network.

I am OK with using setHost(null) but I was wondering if you have any
suggestions?

thank you,

west suhanic
Post by Greg Wilkins
West,
Sounds like there could be some DNS resolution problems on your machine.
Can you do a host lookup for "aaa,bbb.ccc" and get 192.168.20.9? from the
command line?
Perhaps try writing a little test main in java to check that InetAddress
can also look up the name and resolve it.
regards
Post by west suhanic
This is an update to my previous email.
If I use an actual IP address in the setHost call everything works as
expected.
ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(http_config));
http.setPort(8080);
http.setHost( "192.168.20.9" );
http.setIdleTimeout(30000);
http://aaa.bbb.ccc:8080/index.html
thank you,
west suhanic
_______________________________________________
jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
--
Greg Wilkins
2017-12-13 23:11:52 UTC
Permalink
Suhanic,

we need to know more about what is happening and your network environment.
If you are not getting an exception, then jetty is opening something! What
does the log report? Can you us netstat or similar (lsof?) to work out what
port jetty is bound to? Also set the dumpAfterStart property so we can see
what it thinks it is bound to.

regards
Post by west suhanic
I said yesterday that I had a fix. Well after more testing my fix of using
an IP address
with the setHost call did not solve the problem. It led to more problems.
The problems
were only resolved when I either do not call setHost or call it with a
null parameter; i.e., setHost( null ).
My code base has been running smoothly with setHost( hostName ) where
hostname is the fully qualified domain name
for several years against Jetty v9.2.1.x and most recently Jetty
v9.4.1.v20170120. The problems arose when I
upgraded to Jetty v9.4.7.v20170914 and Jetty 9.4.8.v20171121 .
I am using jetty with jdk-8u152 running under gentoo on an X86-64 PC.
My network setup is fine with the machine being accessible to all machines
on my internal network.
I am OK with using setHost(null) but I was wondering if you have any
suggestions?
thank you,
west suhanic
Post by Greg Wilkins
West,
Sounds like there could be some DNS resolution problems on your machine.
Can you do a host lookup for "aaa,bbb.ccc" and get 192.168.20.9? from the
command line?
Perhaps try writing a little test main in java to check that InetAddress
can also look up the name and resolve it.
regards
Post by west suhanic
This is an update to my previous email.
If I use an actual IP address in the setHost call everything works as
expected.
ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(http_config));
http.setPort(8080);
http.setHost( "192.168.20.9" );
http.setIdleTimeout(30000);
http://aaa.bbb.ccc:8080/index.html
thank you,
west suhanic
_______________________________________________
jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
--
--
Greg Wilkins <***@webtide.com> CTO http://webtide.com
west suhanic
2017-12-14 17:02:17 UTC
Permalink
Hello:

Attached are two log files generated by starting up the embedded jetty
servlet.
As you can tell by the file names one is for the case when setHost is set
to null the other when
setHost is set to the hostname-(which is the machine fully qualified domain
name). I suspect that
the problem for the case when setHost is set to the fqdn is that the code
gets the ip address by looking
at the contents of /etc/hosts. As you will see from the log file this leads
to the following:

STDERR: sun.nio.ch.ServerSocketChannelImpl[/127.0.0.1:9443]

As I said I am running gentoo. The /etc/hosts file is a generic gentoo
setup straight from the
gentoo handbook. My particular setup for /etc/hosts is:

127.0.0.1 clearplastc.home.net clearplastic localhost

If /etc/hosts file is not setup this way other system programs do not work
as expected.
Might I suggest that setHost allow the specification of a network interface
to assist in
the acquisition of the IP address to listen to.

I think Jetty is great and you guys do a great job. If you need more
information please ask.

thank you,

west suhanic
Post by Greg Wilkins
Suhanic,
we need to know more about what is happening and your network
environment. If you are not getting an exception, then jetty is opening
something! What does the log report? Can you us netstat or similar (lsof?)
to work out what port jetty is bound to? Also set the dumpAfterStart
property so we can see what it thinks it is bound to.
regards
Post by west suhanic
I said yesterday that I had a fix. Well after more testing my fix of
using an IP address
with the setHost call did not solve the problem. It led to more problems.
The problems
were only resolved when I either do not call setHost or call it with a
null parameter; i.e., setHost( null ).
My code base has been running smoothly with setHost( hostName ) where
hostname is the fully qualified domain name
for several years against Jetty v9.2.1.x and most recently Jetty
v9.4.1.v20170120. The problems arose when I
upgraded to Jetty v9.4.7.v20170914 and Jetty 9.4.8.v20171121 .
I am using jetty with jdk-8u152 running under gentoo on an X86-64 PC.
My network setup is fine with the machine being accessible to all
machines on my internal network.
I am OK with using setHost(null) but I was wondering if you have any
suggestions?
thank you,
west suhanic
Post by Greg Wilkins
West,
Sounds like there could be some DNS resolution problems on your machine.
Can you do a host lookup for "aaa,bbb.ccc" and get 192.168.20.9? from
the command line?
Perhaps try writing a little test main in java to check that InetAddress
can also look up the name and resolve it.
regards
Post by west suhanic
This is an update to my previous email.
If I use an actual IP address in the setHost call everything works as
expected.
ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(http_config));
http.setPort(8080);
http.setHost( "192.168.20.9" );
http.setIdleTimeout(30000);
http://aaa.bbb.ccc:8080/index.html
thank you,
west suhanic
_______________________________________________
jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
--
--
Greg Wilkins
2017-12-14 18:09:16 UTC
Permalink
West,

You are setting the host to "clearplastc.home.net", but your host setup
gives the IP address of that name as 127.0.0.1, so that is the interface
that jetty binds to.

I think it is very strange that gentoo is setup like that?


We just do `new InetSocketAddress(getHost(), getPort())`, so there is not
really any opportunity to open by interface.

Why don't you open a ServerSocketChannel yourself after resolving the
address however you want and pass it into the connector with
open(ServerSocketChannel)?

cheers
Post by west suhanic
Attached are two log files generated by starting up the embedded jetty
servlet.
As you can tell by the file names one is for the case when setHost is set
to null the other when
setHost is set to the hostname-(which is the machine fully qualified
domain name). I suspect that
the problem for the case when setHost is set to the fqdn is that the code
gets the ip address by looking
at the contents of /etc/hosts. As you will see from the log file this
STDERR: sun.nio.ch.ServerSocketChannelImpl[/127.0.0.1:9443]
As I said I am running gentoo. The /etc/hosts file is a generic gentoo
setup straight from the
127.0.0.1 clearplastc.home.net clearplastic localhost
If /etc/hosts file is not setup this way other system programs do not work
as expected.
Might I suggest that setHost allow the specification of a network
interface to assist in
the acquisition of the IP address to listen to.
I think Jetty is great and you guys do a great job. If you need more
information please ask.
thank you,
west suhanic
Post by Greg Wilkins
Suhanic,
we need to know more about what is happening and your network
environment. If you are not getting an exception, then jetty is opening
something! What does the log report? Can you us netstat or similar (lsof?)
to work out what port jetty is bound to? Also set the dumpAfterStart
property so we can see what it thinks it is bound to.
regards
Post by west suhanic
I said yesterday that I had a fix. Well after more testing my fix of
using an IP address
with the setHost call did not solve the problem. It led to more
problems. The problems
were only resolved when I either do not call setHost or call it with a
null parameter; i.e., setHost( null ).
My code base has been running smoothly with setHost( hostName ) where
hostname is the fully qualified domain name
for several years against Jetty v9.2.1.x and most recently Jetty
v9.4.1.v20170120. The problems arose when I
upgraded to Jetty v9.4.7.v20170914 and Jetty 9.4.8.v20171121 .
I am using jetty with jdk-8u152 running under gentoo on an X86-64 PC.
My network setup is fine with the machine being accessible to all
machines on my internal network.
I am OK with using setHost(null) but I was wondering if you have any
suggestions?
thank you,
west suhanic
Post by Greg Wilkins
West,
Sounds like there could be some DNS resolution problems on your machine.
Can you do a host lookup for "aaa,bbb.ccc" and get 192.168.20.9? from
the command line?
Perhaps try writing a little test main in java to check that
InetAddress can also look up the name and resolve it.
regards
Post by west suhanic
This is an update to my previous email.
If I use an actual IP address in the setHost call everything works as
expected.
ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(http_config));
http.setPort(8080);
http.setHost( "192.168.20.9" );
http.setIdleTimeout(30000);
http://aaa.bbb.ccc:8080/index.html
thank you,
west suhanic
_______________________________________________
jetty-users mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
--
--
--
Greg Wilkins <***@webtide.com> CTO http://webtide.com
west suhanic
2017-12-15 20:43:06 UTC
Permalink
Hi Greg:

Yes the gentoo /etc/hosts is unusual.

However when you say "...and pass it into the connector with
open(ServerSocketChannel)?" would I do approximately the following?

final ServerConnector theSslConnector = new ServerConnector(...)

theChannel = new java.nio.channels.ServerSocketChannel();
theSslConnector.open(theChannel)
theSslConnector.setPort( sslPort );

theServer.addConnector( theSslConnector );

thanks,

west
Post by Greg Wilkins
West,
You are setting the host to "clearplastc.home.net", but your host setup
gives the IP address of that name as 127.0.0.1, so that is the interface
that jetty binds to.
I think it is very strange that gentoo is setup like that?
We just do `new InetSocketAddress(getHost(), getPort())`, so there is not
really any opportunity to open by interface.
Why don't you open a ServerSocketChannel yourself after resolving the
address however you want and pass it into the connector with
open(ServerSocketChannel)?
cheers
Post by west suhanic
Attached are two log files generated by starting up the embedded jetty
servlet.
As you can tell by the file names one is for the case when setHost is set
to null the other when
setHost is set to the hostname-(which is the machine fully qualified
domain name). I suspect that
the problem for the case when setHost is set to the fqdn is that the code
gets the ip address by looking
at the contents of /etc/hosts. As you will see from the log file this
STDERR: sun.nio.ch.ServerSocketChannelImpl[/127.0.0.1:9443]
As I said I am running gentoo. The /etc/hosts file is a generic gentoo
setup straight from the
127.0.0.1 clearplastc.home.net clearplastic localhost
If /etc/hosts file is not setup this way other system programs do not
work as expected.
Might I suggest that setHost allow the specification of a network
interface to assist in
the acquisition of the IP address to listen to.
I think Jetty is great and you guys do a great job. If you need more
information please ask.
thank you,
west suhanic
Post by Greg Wilkins
Suhanic,
we need to know more about what is happening and your network
environment. If you are not getting an exception, then jetty is opening
something! What does the log report? Can you us netstat or similar (lsof?)
to work out what port jetty is bound to? Also set the dumpAfterStart
property so we can see what it thinks it is bound to.
regards
Post by west suhanic
I said yesterday that I had a fix. Well after more testing my fix of
using an IP address
with the setHost call did not solve the problem. It led to more
problems. The problems
were only resolved when I either do not call setHost or call it with a
null parameter; i.e., setHost( null ).
My code base has been running smoothly with setHost( hostName ) where
hostname is the fully qualified domain name
for several years against Jetty v9.2.1.x and most recently Jetty
v9.4.1.v20170120. The problems arose when I
upgraded to Jetty v9.4.7.v20170914 and Jetty 9.4.8.v20171121 .
I am using jetty with jdk-8u152 running under gentoo on an X86-64 PC.
My network setup is fine with the machine being accessible to all
machines on my internal network.
I am OK with using setHost(null) but I was wondering if you have any
suggestions?
thank you,
west suhanic
Post by Greg Wilkins
West,
Sounds like there could be some DNS resolution problems on your machine.
Can you do a host lookup for "aaa,bbb.ccc" and get 192.168.20.9? from
the command line?
Perhaps try writing a little test main in java to check that
InetAddress can also look up the name and resolve it.
regards
Post by west suhanic
This is an update to my previous email.
If I use an actual IP address in the setHost call everything works as
expected.
ServerConnector http = new ServerConnector(server,
new HttpConnectionFactory(http_config));
http.setPort(8080);
http.setHost( "192.168.20.9" );
http.setIdleTimeout(30000);
http://aaa.bbb.ccc:8080/index.html
thank you,
west suhanic
_______________________________________________
jetty-users mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
--
--
--
Loading...