This kind of behavior would happen to me on Mac OS X El Capitan using Jetty
9.3.15.v20161220. It was easy to reproduce:

1. Make my cell phone a WIFI hotspot
2. Disable cellular data, thus making the hotspot a deadend
3. Connect my Mac to the hotspot
4. Start embedded Jetty

It would hang when log4j was being initialized and actually had nothing to
do with Jetty. It would hang here:

InetAddress addr = InetAddress.getLocalHost() in NetUtils.

I fixed it by adding my laptop's hostname and localhost to /etc/hosts as
127.0.0.1 and ::1. See [1]

I know that it is somewhat different situation, but I'm wondering if the
root cause is the same -- slow DNS resolution in Java's InetAddress.

HTH!

[1]
https://stackoverflow.com/questions/33289695/inetaddress-getlocalhost-slow-to-run-30-seconds

On Sun, Aug 20, 2017 at 11:27 AM John Carrieri <[email protected]>
wrote:

> Jetty 9.4.6
> Java build 1.8.0_65-b17
> Debian:  Jessie
> It’s being started by our Application server Terascript
>
> Configuration file is named localhost.xml and the previous mentioned line
> Is where the errors come from if there is no Internet connection:
>
> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "
>>> http://www.eclipse.org/jetty/configure_9_3.dtd”>
>>>
>>
> Thanks
> John
>
>
>
> On Aug 19, 2017, at 7:52 PM, Jan Bartel <[email protected]> wrote:
>
> What version of jetty? How are you starting it - embedded, distro, maven
> ... ? What jdk? What os?
>
> Jetty does not need an internet connection to resolve the dtd and schemas
> - that has always been taken care of by code in the jetty-xml jar. I just
> tested jetty-9.4.7.RC0 and reconfirmed this, so you'll need to provide more
> details on your setup.
>
> Jan
>
> On 20 August 2017 at 14:40, Thomas Maslen <[email protected]>
> wrote:
>
>> With the caveat that this isn't a complete answer, just the first little
>> piece of one...
>>
>> XML Catalog(ue) files exist to solve this sort of thing.  They let you
>> express "when you encounter a reference to this XML-related object, satisfy
>> it by using the local copy stored here".  For a DTD (the case you're
>> dealing with here), the XML catalog lets you identify "this XML-related
>> object" either by the PUBLIC id or by the System ID (that www.eclipse.org
>> URL) or both.
>>
>> The other 90% of the answer would be:  how do you configure the right
>> parts of Jetty to use an XML Catalogue?  That part I don't know, but my
>> guess is your chances of getting an answer from folks who do know may
>> improve if you state the version of Jetty you're using.
>>
>> (Perhaps it may also be possible to hack a solution by editing that line
>> and replacing the www.eclipse.org URL with a relative reference to a
>> local copy, e.g. "./configure_9_3.dtd", but that's a bit cheesy).
>>
>>
>> On Sat, Aug 19, 2017 at 8:26 PM, John Carrieri <[email protected]>
>> wrote:
>>
>>> Hi, we have a web application that is based on Jetty.   We would like it
>>> to be able to start
>>> even if there is not an internet connection on the local system.
>>>
>>> The configuration line attempts resolve www.eclipse.org on startup.
>>> While putting in
>>> an IP address might take care of it not trying to resolve, that’s a bad
>>> strategy to deploy
>>> on remote devices.     Is there a way to just put the .dtd configuration
>>> file it’s looking at
>>> on the local drive and reference it there.   I tried it but it did not
>>> seem to work, using a file://
>>> notation.
>>>
>>> If there is a way please let me know the exact notation.
>>>
>>> Here is the configuration line I’m referring to:
>>>
>>> <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "
>>> http://www.eclipse.org/jetty/configure_9_3.dtd”>
>>>
>>> Thanks
>>>
>>>
>>> _______________________________________________
>>> jetty-users mailing list
>>> [email protected]
>>> To change your delivery options, retrieve your password, or unsubscribe
>>> from this list, visit
>>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>>
>>
>>
>> _______________________________________________
>> jetty-users mailing list
>> [email protected]
>> To change your delivery options, retrieve your password, or unsubscribe
>> from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/jetty-users
>>
>
>
>
> --
> Jan Bartel <[email protected]>
> www.webtide.com
> *Expert assistance from the creators of Jetty and CometD*
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
>
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to