java.lang.IllegalArgumentException: Invalid toDo in servlet mappin

 

java.lang.IllegalArgumentException: Invalid toDo in servlet mapping

 

在学习Servlet3.0的AsyncContext时出现的错误。

 

 

java.lang.IllegalArgumentException: Invalid  toDo in servlet mapping
	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3113)
	at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3088)
	at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1274)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1265)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5061)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1044)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:967)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1305)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
	at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:379)
	at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:324)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
	at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
	at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
 

问题:

@WebServlet(name="testServlet",urlPatterns="toDo ",asyncSupported=true)

 

原因:少了一个 /

 

正确:

@WebServlet(name="testServlet",urlPatterns="/toDo ",asyncSupported=true)

 

 

这个问题可能很难发现,但最后还是发现了。O(∩_∩)O哈哈~

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

蕃薯耀 2012年9月29日 00:32:07 星期六

你可能感兴趣的:(蕃薯耀分享,java)