启动tomcat闪退,logs中提示元素类型 "Context" 必须由匹配的结束标记 "</Context>" 终止的解决方法

报错日志:

五月 10, 2016 3:02:30 下午 org.apache.catalina.startup.Catalina load

警告: Catalina.start using conf/server.xml: 元素类型 "Context" 必须由匹配的结束标记 "</Context>" 终止。

五月 10, 2016 3:02:30 下午 org.apache.tomcat.util.digester.Digester fatalError

严重: Parse Fatal Error at line 148 column 7: 元素类型 "Context" 必须由匹配的结束标记 "</Context>" 终止。

org.xml.sax.SAXParseException; systemId: file:/F:/Tomcat/apache-tomcat-7.0.65/conf/server.xml; lineNumber: 148; columnNumber: 7; 元素类型 "Context" 必须由匹配的结束标记 "</Context>" 终止。

at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)

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:400)

at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)

at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1437)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1750)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2970)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)

at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)

at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1555)

at org.apache.catalina.startup.Catalina.load(Catalina.java:615)

at org.apache.catalina.startup.Catalina.start(Catalina.java:677)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428)

找到代码

<?xml version=‘1.0‘ encoding=‘utf-8‘?>

<!--

Licensed to the Apache Software Foundation (ASF) under one or more

contributor license agreements.  See the NOTICE file distributed with

this work for additional information regarding copyright ownership.

The ASF licenses this file to You under the Apache License, Version 2.0

(the "License"); you may not use this file except in compliance with

the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

-->

<!-- Note:  A "Server" is not itself a "Container", so you may not

define subcomponents such as "Valves" at this level.

Documentation at /docs/config/server.html

-->

<Server port="8005" shutdown="SHUTDOWN">

<Listener className="org.apache.catalina.startup.VersionLoggerListener" />

<!-- Security listener. Documentation at /docs/config/listeners.html

<Listener className="org.apache.catalina.security.SecurityListener" />

-->

<!--APR library loader. Documentation at /docs/apr.html -->

<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />

<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->

<Listener className="org.apache.catalina.core.JasperListener" />

<!-- Prevent memory leaks due to use of particular java/javax APIs-->

<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />

<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

<!-- Global JNDI resources

Documentation at /docs/jndi-resources-howto.html

-->

<GlobalNamingResources>

<!-- Editable user database that can also be used by

UserDatabaseRealm to authenticate users

-->

<Resource name="UserDatabase" auth="Container"

type="org.apache.catalina.UserDatabase"

description="User database that can be updated and saved"

factory="org.apache.catalina.users.MemoryUserDatabaseFactory"

pathname="conf/tomcat-users.xml" />

</GlobalNamingResources>

<!-- A "Service" is a collection of one or more "Connectors" that share

a single "Container" Note:  A "Service" is not itself a "Container",

so you may not define subcomponents such as "Valves" at this level.

Documentation at /docs/config/service.html

-->

<Service name="Catalina">

<!--The connectors can use a shared executor, you can define one or more named thread pools-->

<!--

<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"

maxThreads="150" minSpareThreads="4"/>

-->

<!-- A "Connector" represents an endpoint by which requests are received

and responses are returned. Documentation at :

Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)

Java AJP  Connector: /docs/config/ajp.html

APR (HTTP/AJP) Connector: /docs/apr.html

Define a non-SSL HTTP/1.1 Connector on port 8080

-->

<Connector port="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" />

<!-- A "Connector" using the shared thread pool-->

<!--

<Connector executor="tomcatThreadPool"

port="8080" protocol="HTTP/1.1"

connectionTimeout="20000"

redirectPort="8443" />

-->

<!-- Define a SSL HTTP/1.1 Connector on port 8443

This connector uses the BIO implementation that requires the JSSE

style configuration. When using the APR/native implementation, the

OpenSSL style configuration is required as described in the APR/native

documentation -->

<!--

<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"

maxThreads="150" SSLEnabled="true" scheme="https" secure="true"

clientAuth="false" sslProtocol="TLS" />

-->

<!-- Define an AJP 1.3 Connector on port 8009 -->

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

<!-- An Engine represents the entry point (within Catalina) that processes

every request.  The Engine implementation for Tomcat stand alone

analyzes the HTTP headers included with the request, and passes them

on to the appropriate Host (virtual host).

Documentation at /docs/config/engine.html -->

<!-- You should set jvmRoute to support load-balancing via AJP ie :

<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">

-->

<Engine name="Catalina" defaultHost="localhost">

<!--For clustering, please take a look at documentation at:

/docs/cluster-howto.html  (simple how to)

/docs/config/cluster.html (reference documentation) -->

<!--

<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>

-->

<!-- Use the LockOutRealm to prevent attempts to guess user passwords

via a brute-force attack -->

<Realm className="org.apache.catalina.realm.LockOutRealm">

<!-- This Realm uses the UserDatabase configured in the global JNDI

resources under the key "UserDatabase".  Any edits

that are performed against this UserDatabase are immediately

available for use by the Realm.  -->

<Realm className="org.apache.catalina.realm.UserDatabaseRealm"

resourceName="UserDatabase"/>

</Realm>

<Host name="localhost"  appBase="webapps"

unpackWARs="true" autoDeploy="true">

<!-- SingleSignOn valve, share authentication between web applications

Documentation at: /docs/config/valve.html -->

<!--

<Valve className="org.apache.catalina.authenticator.SingleSignOn" />

-->

<!-- Access log processes all example.

Documentation at: /docs/config/valve.html

Note: The pattern used is equivalent to using pattern="common" -->

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"

prefix="localhost_access_log." suffix=".txt"

pattern="%h %l %u %t &quot;%r&quot; %s %b" />

</Host>

<Host name="www.baidu.com" appBase="E:\baidu"/>

<Host name="www.google.com" appBase="E:\google"/>

<Context path="game" docBase="E:\gametest">

</Context>

</Engine>

</Service>

</Server>

发现原因是   <Context path="game" docBase="E:\gametest">  中没有/(斜杠)

改成

<Context path="game" docBase="E:\gametest"/> 后tomcat可以正常运行

时间: 2024-10-12 20:33:28

启动tomcat闪退,logs中提示元素类型 "Context" 必须由匹配的结束标记 "</Context>" 终止的解决方法的相关文章

Parse Fatal Error at line 41 column 24: 元素类型 &quot;url-pattern&quot; 必须由匹配的结束标记 &quot;&lt;/url-pattern&gt;&quot; 终止

1.错误描述 严重: Parse Fatal Error at line 41 column 24: 元素类型 "url-pattern" 必须由匹配的结束标记 "</url-pattern>" 终止. org.xml.sax.SAXParseException; systemId: jndi:/localhost/SpringMVCH/WEB-INF/web.xml; lineNumber: 41; columnNumber: 24; 元素类型 &qu

启动tomcat闪退

启动tomcat,点击startup.bat闪退 使用的Tomcat是免安装版本的. 因为在启动tomcat是需要读取环境变量和配置信息,缺少了这些信息,就不能登记环境变量,导致了tomcat的闪退. 解决办法: 1:在已解压的tomcat的bin文件夹下找到startup.bat,右击->编辑.在文件头加入下面两行: SET JAVA_HOME=D:\Java\jdk1.7 (java jdk目录)SET TOMCAT_HOME=E:\tomcat-7.0 (解压后的tomcat文件目录) 2

windows启动tomcat闪退

现象:windows下双击tomcat\bin\startup.bat时闪退 原因:缺少环境变量导致 解决方法:打开编辑tomcat\bin\startup.bat,头部加入以下代码,一个是JAVA目录,一个是Tomcat目录 SET JAVA_HOME=C:\Program Files\Java\jdk1.6.0_39SET TOMCAT_HOME=D:\hunk\work\apache-tomcat-6.0.43 - 副本 再次双击tomcat\bin\startup.bat,OK了. ??

HADOOP 启动NodeManager闪退,logs信息:java.net.NoRouteToHostException: 没有到主机的路由

提示LOGS信息 org.apache.hadoop.yarn.exceptions.YarnRuntimeException: java.net.NoRouteToHostException: No Route to Host from dataNode1/192.168.2.247 to nameNode:8031 failed on socket timeout exception: java.net.NoRouteToHostException: 没有到主机的路由; For more d

Firefox上运行自动化测试脚本提示元素无法点击“WebDriverException: Message: Element is not clickable at point“解决方法

1. Firefox上运行脚本时提示“WebDriverException: Message: Element is not clickable at point (934.316650390625, 700.316650390625). Other element would receive the click:” 2.分析原因: (1)首先肯定不是因为页面元素不存在而无法点击,也不是要点击的button不在预览范围内. (2)可能是被前一步的操作的一个弹出层挡住了.因为前几步是弹出了一个mo

tomcat单独启动时闪退的解决办法,以及修改端口8080为80,

tomcat单独启动时闪退的解决办法: 点击" startup",马上就闪退了:原因一般都是没有配置%JAVA_HOME%和tomcat的环境变量造成的: 很简单: 在startup.bat那个文件下,编辑点进去之后,在最上边的echo off上面加上: SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_60 SET TOMCAT_HOME=C:\apache-tomcat-7.0.53 然后shutdown.bat里面也要加上这两句话: 然后重

Tomcat学习笔记 - 错误日志 - Tomcat安装版安装后第二次启动后闪退(转)-- javac不是内部或外部命令 -- 配置java环境教程

如果安装成功并且安装完成第一次启动是成功的,第二次就闪退的话,原因之一是没有配置java的环境.在网上找的配制方法有很多错误,测试javac命令时候会提示不是内部或外部命令,找到一个正确的教程.如下,转载自百度经验:http://jingyan.baidu.com/article/1e5468f924210a484961b7f0.html 'JAVA' 不是内部或外部命令,也不是可运行的程序 或批处理文件解决办法相似. 原因一:没有安装jdk,只安装了jre 1 jdk1.7.0_60+jre才

java web工程发布以及解决tomcat闪退

1.tomcat闪退 a.环境变量错误 startup.bat最后假如PAUSE进入调试状态,双击startup.bat,可以看到错误,根据错误提示设置相应的环境变量,JAVA_HOME等. b.eclispe设置问题,当eclispe server locations选项为第一项时,tomcat无法独立运行,由于本人学术不精,只定位出问题所在,还望大神帮答问题所在原因. 2.eclipse发布web工程 a.将server locations设置为可配状态 右键server,选择Add and

iOS 启动连续闪退保护方案

引言 “如果某个实体表现出以下任何一种特性,它就具备自主性:自我修复.自我保护.自我维护.对目标的自我控制.自我改进.” —— 凯文·凯利 iOS App 有时可能遇到启动必 crash 的绝境:每次打开 App 都闪退,无法正常使用App. 为了尝试解决这个问题,微信读书开发了 iOS 连续闪退保护工具:GYBootingProtection,检测连续闪退,在连续闪退出现时,尝试自修复 App: 本文探讨了连续闪退问题的产生原因.检测.修复机制,以及如何在你的项目中引入.测试和使用 GYBoo