Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Way to start Jetty without requiring internet connection

John,

That error is not a jetty xml parsing error.  Are you running in osgi? Please enable debug logging as appropriate for your environment so you can see where this error is emanating from.

Jan

On 13 October 2017 at 08:12, John Carrieri <jcarrieri@xxxxxxxxxxxx> wrote:
Hi I was wondering if anyone had any more ideas for me in regards to getting jetty to start if there is no internet connection?

I did try some of the other suggestions.

1.  Adding hostname in hosts file did not get around the issue.
2.  I added eclipse.org  and www.eclipse.org ip in hosts file.  (Not ideal by any means, but wanted to rule out if it was merely from dns resolution.
3.  Without an internet connection, but with eclipse.org ip defined, I’ll still get a
 java.net.NoRouteToHostException: No route to host

4.  I did try / correct the public doctype notation as per Joakim’s suggestion but that did not resolve the issue, although I think the suggestion was just to have the correct one.
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

I believe I still need to have the correct notation to load configure_9_3.dtd locally.

-John


10/01/2017 14:38:56.983   15 0  ERROR BUNDLE error reading XML configuration /usr/share/terascript/server/webconfig/contexts/localhost.xml: 
java.net.UnknownHostException: www.eclipse.org


10/01/2017 14:46:33.393   15 0  ERROR BUNDLE error reading XML configuration /usr/share/terascript/server/webconfig/contexts/localhost.xml: 
java.net.SocketException: Network is unreachable






On Aug 20, 2017, at 3:27 AM, Travis Spencer <travislspencer@xxxxxxxxx> wrote:

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 <jcarrieri@xxxxxxxxxxxx> 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 <janb@xxxxxxxxxxx> 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 <thomas.mpp.maslen@xxxxxxxxx> 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 <jcarrieri@xxxxxxxxxxxx> 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
jetty-users@xxxxxxxxxxx
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
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
Expert assistance from the creators of Jetty and CometD

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
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
jetty-users@xxxxxxxxxxx
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
jetty-users@xxxxxxxxxxx
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
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
Expert assistance from the creators of Jetty and CometD


Back to the top