jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

maven & jetty-maven-plugin & offline error:java.net.UnknownHostException: www.eclipse.org

Open lin1005q opened this issue 8 years ago • 15 comments

why mvn jetty:run is connect www.eclipse.org :smiley: Thank you And what should i do?

lin1005q avatar Jan 18 '18 08:01 lin1005q

@weihai4099 can you please provide more information, there is not enough here for me to comment. Please provide:

  • jetty version
  • the exact mvn command line
  • all log output from run with mvn -X jetty:run

janbartel avatar Jan 18 '18 10:01 janbartel

yes,I do.

  • 9.4.8.v20171121 and 9.4.4.v20170414 too

  • S:\java8.131\bin\java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:1097,suspend=y,server=n -Drebel.base=C:\Users\Administrator\.jrebel -Drebel.env.ide.plugin.version=7.1.3 -Drebel.env.ide.version=2017.3 -Drebel.env.ide.product=IU -Drebel.env.ide=intellij -Drebel.notification.url=http://localhost:17434 -agentpath:C:\Users\Administrator\.IntelliJIdea2017.3\config\plugins\jr-ide-idea\lib\jrebel6\lib\jrebel64.dll -Dmaven.multiModuleProjectDirectory=D:\456\eap\monitor -Dfile.encoding=UTF-8 -Dmaven.home=E:\apache-maven-3.5.2 -Dclassworlds.conf=E:\apache-maven-3.5.2\bin\m2.conf -javaagent:S:\jetbrain\apps\IDEA-U\ch-0\173.3727.127\lib\rt\debugger-agent.jar=C:\Users\Administrator\AppData\Local\Temp\capture4521.props -classpath E:\apache-maven-3.5.2\boot\plexus-classworlds-2.5.2.jar;S:\jetbrain\apps\IDEA-U\ch-0\173.3727.127\lib\idea_rt.jar org.codehaus.classworlds.Launcher -Didea.version=2017.3 -s E:\apache-maven-3.5.2\conf\settings.xml -DskipTests=true jetty:run I'm using idea and jrebel

  • the file is large 11.1MB. You can search by java.net.UnknownHostException: www.eclipse.org mvn.log

lin1005q avatar Jan 18 '18 14:01 lin1005q

Looks like the DOCTYPE line in your jetty-web.xml is not correct.

Should be:

<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

janbartel avatar Jan 18 '18 15:01 janbartel

@janbartel The DOCTYPE described in the 9.4.x documentation is ...

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
      "http://www.eclipse.org/jetty/configure_9_3.dtd">

The System-ID is -//Jetty//Configure//EN, not -//Mort Bay Consulting//DTD Configure//EN

joakime avatar Jan 18 '18 16:01 joakime

@joakime we'd better add an issue then to convert the test-jetty-webapp's jetty-web.xml :)

janbartel avatar Jan 18 '18 16:01 janbartel

Yeah. probably a good thing.

I know that @WalkerWatch did a big sweep through the documentation to make the DOCTYPE consistent about a year ago.

joakime avatar Jan 18 '18 16:01 joakime

@janbartel I guess the XMLConfiguration doesn't care about or validate the System-ID?

joakime avatar Jan 18 '18 16:01 joakime

Hhhm, there is more to this error. It appears that as the dtds are in org.eclipse.jetty.xml , this is a serverClass package and thus access to the dtds are being denied.

Looking into this further, but looks like we need to make a change in the code.

janbartel avatar Jan 18 '18 17:01 janbartel

@weihai4099 as a workaround, make a context xml file for your webapp, and add the following line:

<Call name="prependServerClass"><Arg>org.eclipse.jetty.xml.</Arg></Call>

janbartel avatar Jan 18 '18 17:01 janbartel

@janbartel should we create an issue for Jetty 10.x and an upgrade for http://www.eclipse.org/jetty/configure_9_3.dtd -> http://www.eclipse.org/jetty/configure_10.dtd

joakime avatar Jan 18 '18 18:01 joakime

@joakime I don't think we've changed any syntax, so no need for a configure_10.dtd.

But I have opened another issue to ensure the DOCTYPEs are correct on our test webapp xmls: https://github.com/eclipse/jetty.project/issues/2139

janbartel avatar Jan 18 '18 18:01 janbartel

@janbartel like this: file name: jetty-web.xml conent:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

<Configure class="org.eclipse.jetty.webapp.WebAppContext">

    <!-- Allow symbolic links  -->
    <Call name="addAliasCheck">
        <Arg><New class="org.eclipse.jetty.server.handler.AllowSymLinkAliasChecker"/></Arg>
    </Call>

    <Call name="prependServerClass">
        <Arg>org.eclipse.jetty.xml.</Arg>
    </Call>

</Configure>

The result is still not good.

mvn.log

It's good where delete the file jetty-web.xml

lin1005q avatar Jan 19 '18 04:01 lin1005q

@weihai4099 Try adding a simple jetty.xml to your maven-plugin definition (for example src/test/resources/jetty.xml).

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server"> </Configure>

kriss-s avatar Jan 19 '18 09:01 kriss-s

No not with a jetty-web.xml, that is interpreted too late. You need a context xml file that you apply with the contextXml maven parameter. Have a look on the jetty documentation for an example. https://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html

janbartel avatar Jan 19 '18 15:01 janbartel

@janbartel Thank you . It's Ok.

lin1005q avatar Jan 20 '18 01:01 lin1005q