我正在创建简单的网络应用程序。而且我在服务器配置方面遇到了问题。当我尝试启动服务器时,我收到一个错误元素类型“主机”必须由匹配的结束标签“”终止
但我的主机标签看起来像以下方式(并且,是的,它已关闭):
<?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 "%r" %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>".**
但是,如果我正在运行具有管理员权限的应用程序(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)