maven & jetty-maven-plugin & offline error:java.net.UnknownHostException: www.eclipse.org
why mvn jetty:run is connect www.eclipse.org :smiley: Thank you
And what should i do?
@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
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:runI'm using idea and jrebel -
the file is large 11.1MB. You can search by
java.net.UnknownHostException: www.eclipse.orgmvn.log
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 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 we'd better add an issue then to convert the test-jetty-webapp's jetty-web.xml :)
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.
@janbartel I guess the XMLConfiguration doesn't care about or validate the System-ID?
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.
@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 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 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 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.
It's good where delete the file jetty-web.xml
@weihai4099 Try adding a simple jetty.xml to your maven-plugin definition (for example
<?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>
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 Thank you . It's Ok.