"终止-6ren"> "终止-我正在创建简单的网络应用程序。而且我在服务器配置方面遇到了问题。当我尝试启动服务器时,收到错误消息 The element type "Host"must be terminated by the m-6ren">
gpt4 book ai didi

java - 元素类型 "Host"必须由匹配的结束标记 ""终止

转载 作者:行者123 更新时间:2023-11-28 22:22:07 27 4
gpt4 key购买 nike

我正在创建简单的网络应用程序。而且我在服务器配置方面遇到了问题。当我尝试启动服务器时,收到错误消息 The element type "Host"must be terminated by the matching end-tag ""
但我的主机标签看起来像以下方式(是的,它已关闭):

<?xml version="1.0" encoding="UTF-8"?>
<Server port="${base.shutdown.port}" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.JasperListener" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener
className="com.springsource.tcserver.serviceability.deploy.TcContainerDeployer" />
<Listener accessFile="${catalina.base}/conf/jmxremote.access"
authenticate="true" bind="127.0.0.1"
className="com.springsource.tcserver.serviceability.rmi.JmxSocketListener"
passwordFile="${catalina.base}/conf/jmxremote.password" port="${base.jmx.port}"
useSSL="false" />
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase"
pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase" />
</GlobalNamingResources>
<Service name="Catalina">
<Executor maxThreads="300" minSpareThreads="50" name="tomcatThreadPool"
namePrefix="tomcat-http--" />
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase" />
</Realm>
<Host appBase="webapps" autoDeploy="true" deployOnStartup="true"
deployXML="true" name="localhost" unpackWARs="true">
<Valve directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log."
suffix=".txt" className="org.apache.catalina.valves.AccessLogValve"/>
<Context docBase="SimpleBlog" path="/simpleblog" reloadable="true"
source="org.eclipse.jst.jee.server:SimpleBlog"/>
</Host>
</Engine>
<Connector acceptCount="100" connectionTimeout="20000"
executor="tomcatThreadPool" maxKeepAliveRequests="15" port="${bio.http.port}"
protocol="org.apache.coyote.http11.Http11Protocol" redirectPort="${bio.https.port}" />
</Service>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
</Server>

我遇到了以下错误:

无法清除服务器中的过时文件:元素类型“Host”必须由匹配的结束标记“”终止。

元素类型“Host”必须以匹配的结束标记 "</Host>".** 结束但是,如果我以管理员 (win7) 的权限运行应用程序,这怎么可能呢?

完整的堆栈跟踪是:

SEVERE: Parse Fatal Error at line 22 column 11: The element type "Host" must be terminated by the matching end-tag "</Host>".
org.xml.sax.SAXParseException; systemId: file:/C:/Program%20Files/Spring%20Tool%20SUite/vfabric-tc-server-developer-2.7.1.RELEASE/spring-insight-instance/conf/server.xml; lineNumber: 22; columnNumber: 11; The element type "Host" must be terminated by the matching end-tag "</Host>".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1375)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1708)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2898)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
at org.apache.catalina.startup.Catalina.load(Catalina.java:601)
at org.apache.catalina.startup.Catalina.load(Catalina.java:649)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)

最佳答案

问题是基础实例 server.xml 没有得到更新。因此手动更新基础实例下的 server.xml 例如 C:\sw\STS\vfabric-tc-server-developer-2.7.2.RELEASE\base-instance\conf

关于java - 元素类型 "Host"必须由匹配的结束标记 "</Host>"终止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12570934/

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