本文介绍了IllegalArgumentException:名为 [com.staff.servlet.AllocationServlet] 和 [com.staff.servlet.SearchConditionServlet] 的 servlet 均已映射的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试执行一个项目时,即使没有项目运行,我也总是收到此错误.我想摆脱这个问题.请帮助我的朋友.解决这个问题的方法是什么?我的控制台说,

when i try to execute a project, always i get this error even when there is no project running. i want to get rid from this issue. please help me out friends.what is the solution for this?my console said,

    Nov 27, 2013 8:54:38 PM org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance  in production environments was not found on the java.library.path: C:\Program Files   (x86)\Java\jdk1.6.0_24\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Prog ram Files (x86)/Java/jdk1.6.0_24/bin/../jre/bin/client;C:/Program Files  (x86)/Java/jdk1.6.0_24/bin/../jre/bin;C:/Program Files  (x86)/Java/jdk1.6.0_24/bin/../jre/lib/i386;C:\Program Files  (x86)\Java\jdk1.6.0_24\bin;C:\Program Files (x86)\PC Connectivity  Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Windo        wsPowerShell\v1.0\;;C:\Program Files (x86)\Samsung\Samsung PC Studio 3\;c:\Program  Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL  Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files  (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files  (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;c:\Program Files  (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\MySQL\MySQL Server  5.5\bin;C:\Program Files (x86)\QuickTime\QTSystem\
    Nov 27, 2013 8:54:38 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property  'source' to 'org.eclipse.jst.jee.server:staffs' did not find a matching property.
    Nov 27, 2013 8:54:38 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["http-bio-8080"]
    Nov 27, 2013 8:54:38 PM org.apache.coyote.AbstractProtocol init
    INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
    Nov 27, 2013 8:54:38 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 753 ms
    Nov 27, 2013 8:54:38 PM org.apache.catalina.core.StandardService startInternal
    INFO: Starting service Catalina
    Nov 27, 2013 8:54:38 PM org.apache.catalina.core.StandardEngine startInternal
    INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
    Nov 27, 2013 8:54:39 PM org.apache.catalina.loader.WebappClassLoader  validateJarFile
    INFO:  validateJarFile(C:\Users\Ramya\workspace1\.metadata\.plugins\org.eclipse.wst.server.core\tm p0\wtpwebapps\staffs\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3,  section 9.7.2. Offending class: javax/servlet/Servlet.class
    Nov 27, 2013 8:54:39 PM org.apache.catalina.core.ContainerBase startInternal
    SEVERE: A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException:  Failed to start component  [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/staffs]]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component  [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/staffs]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7 more
    Caused by: java.lang.IllegalArgumentException: The servlets named   [com.staff.servlet.AllocationServlet] and [com.staff.servlet.SearchConditionServlet] are  both mapped to the url-pattern [/AllocationServlet] which is not permitted
at org.apache.catalina.deploy.WebXml.addServletMapping(WebXml.java:335)
at  org.apache.catalina.startup.ContextConfig.processAnnotationWebServlet(ContextConfig.java:24 50)
at  org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2132)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2086)
at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2086)
at  org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2086)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1293)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
    Nov 27, 2013 8:54:39 PM org.apache.catalina.core.ContainerBase startInternal
    SEVERE: A child container failed during start
    java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException:     Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.startup.Catalina.start(Catalina.java:691)
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:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component  [StandardEngine[Catalina].StandardHost[localhost]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at     java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
    Caused by: org.apache.catalina.LifecycleException: A child container failed during  start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
    Nov 27, 2013 8:54:39 PM org.apache.catalina.startup.Catalina start
    SEVERE: The required Server component failed to start so Tomcat is unable to start.
    org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.startup.Catalina.start(Catalina.java:691)
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:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)
    Caused by: org.apache.catalina.LifecycleException: Failed to start component  [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
    Caused by: org.apache.catalina.LifecycleException: Failed to start component  [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 9 more
    Caused by: org.apache.catalina.LifecycleException: A child container failed during start
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1131)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

    ... 11 more
    Nov 27, 2013 8:54:39 PM org.apache.coyote.AbstractProtocol pause
    INFO: Pausing ProtocolHandler ["http-bio-8080"]
    Nov 27, 2013 8:54:39 PM org.apache.coyote.AbstractProtocol pause
    INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
    Nov 27, 2013 8:54:39 PM org.apache.catalina.core.StandardService stopInternal
    INFO: Stopping service Catalina
    Nov 27, 2013 8:54:39 PM org.apache.coyote.AbstractProtocol destroy
    INFO: Destroying ProtocolHandler ["http-bio-8080"]
    Nov 27, 2013 8:54:39 PM org.apache.coyote.AbstractProtocol destroy
    INFO: Destroying ProtocolHandler ["ajp-bio-8009"]

有什么解决办法?

推荐答案

异常不言自明

by: java.lang.IllegalArgumentException: 名为 [com.staff.servlet.AllocationServlet] 和 [com.staff.servlet.SearchConditionServlet] 的 servlet 都映射到不允许的 url-pattern [/AllocationServlet]

您的两个 servlet 似乎是

It seems that two of your servlets namely

  1. AllocationServlet
  2. SearchConditionServlet

两者都映射到相同的 url-pattern AllocationServlet

both are mapped to the same url-pattern AllocationServlet

您需要修复 servlet 的 web.xml 或注释(在 Servlet3.0 的情况下),并确保没有两个 servlet 映射到相同的 url-pattern.

You need to fix your web.xml or annotations ( in case of Servlet3.0) of the servlets and make sure no two servlets are mapped to the same url-pattern.

这篇关于IllegalArgumentException:名为 [com.staff.servlet.AllocationServlet] 和 [com.staff.servlet.SearchConditionServlet] 的 servlet 均已映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-08 21:24