未能启动组件的问题 by: java.lang.IllegalArgumentException: Failed to register servlet with name 'dispatcher'.

困扰已久的bug,百度无结果,谷歌有3,4篇文章跟我的一样,也没得到答案。

后来经过分析,bug得到解决。

分析:

未能启动组件异常::Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[

查看原因:Caused by: java.lang.IllegalArgumentException: Failed to register servlet with name 'dispatcher'.Check if there is another servlet registered under the same name.
定位错误:at com.jt.sys.config.WebAppInitializer.onStartup(WebAppInitializer.java:16)


看项目目录发现居然有2个同样的配置类包,



项目目录下面还有一个包放的是上面同样的类。无语了,导项目出现奇葩bug,困扰了2天妈的。
怪不得说会有相同的servlet。

严重: ContainerBase.addChild: start: 
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/CGB-JT-SYS-V1.01]]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1017)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:993)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:712)
	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:2003)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: Failed to register servlet with name 'dispatcher'.Check if there is another servlet registered under the same name.
	at org.springframework.util.Assert.notNull(Assert.java:134)
	at org.springframework.web.servlet.support.AbstractDispatcherServletInitializer.registerDispatcherServlet(AbstractDispatcherServletInitializer.java:98)
	at org.springframework.web.servlet.support.AbstractDispatcherServletInitializer.onStartup(AbstractDispatcherServletInitializer.java:71)
	at com.jt.sys.config.WebAppInitializer.onStartup(WebAppInitializer.java:16)
	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5669)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	... 10 more

七月 06, 2018 10:16:21 下午 org.apache.catalina.startup.HostConfig deployDescriptor
严重: Error deploying configuration descriptor D:\ws1803\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\Catalina\localhost\CGB-JT-SYS-V1.01.xml
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/CGB-JT-SYS-V1.01]]
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1021)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:993)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:712)
	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:2003)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值