Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/account

Tomcat报错:

严重: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/account]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2038)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> ShowAccount in servlet mapping
	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3429)
	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3404)
	at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1438)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1359)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:888)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5522)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	... 10 more
五月 15, 2020 8:32:00 下午 org.apache.catalina.startup.HostConfig deployDirectory
严重: Error deploying web application directory D:\tools\apache-tomcat-7.0.79\webapps\account
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/account]]
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:903)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2038)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

先搜索了一下url-pattern的错误提示,找了一圈没有发现问题。最后实在没办法了才去搜多第一个错误,才发现web.xml少写了“/”(参考链接:解决Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]的方法

记录一下这个教训,问题要从头抓起,web.xml格式一定要熟记!
<url-pattern>/</url-pattern>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值