gpt4 book ai didi

xml - jetty 配置:dtd问题

转载 作者:行者123 更新时间:2023-12-03 04:39:51 26 4
gpt4 key购买 nike

我正在使用jetty.xml嵌入在gradle项目中的jetty进行服务器配置。 jetty 有一个XML配置,以使用jettyRunWar(渐变插件)。

这是build.gradle中的jettyRunWar:

jettyRunWar{
contextPath = "/"
httpPort = 8080
jettyConfig = file("./jetty.xml")
reload = "automatic"
scanIntervalSeconds = 10
webApp = file("./build/libs/relevanteme.war")
}

这就是jetty.xml(配置)。
<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">

<Set name="port"><SystemProperty name="jetty.port" default="8080"/></Set>

<New id="webApp" class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>./build/libs/relevanteme.war</Set>

<Call name="addServlet">
<Arg>vjsantojaca.relevante.background.servlets.IdentifyServlet</Arg>
</Call>
</New>

<New id="Relevante" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg>jdbc/Relevante</Arg>
<Arg>
<New class="com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource">
<Set name="Url">jdbc:mysql://localhost:3306/mail_classmachine</Set>
<Set name="User">classmach</Set>
<Set name="Password">lTk54ifRd</Set>
</New>
</Arg>
</New>

<Set name="handler">
<New class="org.eclipse.jetty.server.handler.HandlerCollection">
<Set name="handlers">
<Array type="org.eclipse.jetty.server.Handler">
<Item>
<Ref refid="webApp" />
</Item>
<Item>
<New class="org.eclipse.jetty.server.handler.DefaultHandler" />
</Item>
</Array>
</Set>
</New>
</Set>

</Configure>

当我在gradle中运行命令jettyRunWar并gradle下载jetty xml配置的dtd时,它为我提供了以下信息...
[org.mortbay.log] parsing: sid=file:/home/vjsantojaca/Developer/Relevante/relevanteme-web-2.0/jetty.xml,pid=null
[org.mortbay.log] resolveEntity(-//Jetty//Configure//EN, http://www.eclipse.org/jetty/configure_9_0.dtd)
[org.mortbay.log] Can't exact match entity in redirect map, trying configure_9_0.dtd
[sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@5df6163a5 pairs: {GET /jetty/configure_9_0.dtd HTTP/1.1: null}{User-Agent: Java/1.8.0_31}{Host: www.eclipse.org}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
[sun.net.www.protocol.http.HttpURLConnection] sun.net.www.MessageHeader@2d313c8c14 pairs: {null: HTTP/1.1 200 OK}{Date: Tue, 14 Apr 2015 15:49:05 GMT}{Server: Apache}{Last-Modified: Tue, 11 Mar 2014 16:28:22 GMT}{ETag: "4e2795-239e-4f45735653580"}{Accept-Ranges: bytes}{Content-Length: 9118}{Vary: Accept-Encoding}{Access-Control-Allow-Origin: http://eclipse.org ; https://eclipse.org ; http://www.eclipse.org ; https://www.eclipse.org}{Access-Control-Allow-Methods: GET}{X-NodeID: (null)}{Keep-Alive: timeout=3, max=200}{Connection: Keep-Alive}{Content-Type: text/x-dtd}

为什么会这样呢?

谢谢!!

最佳答案

org.mortbay.log的引用意味着您正在使用Jetty-7之前的古老版本的Jetty(可能是Jetty 6)。

那就是你沮丧的原因。

您的jettyRunWar没有使用Jetty 9,而是使用了Jetty 6(?)

关于xml - jetty 配置:dtd问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29632414/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com