gpt4 book ai didi

eclipse - java.lang.IllegalArgumentException : Invalid coreservlets. ShowItems_ArrayList 异常

转载 作者:行者123 更新时间:2023-11-28 23:31:45 25 4
gpt4 key购买 nike

Eclipse 版本:开普勒服务发布 1

构建编号:20130919-0819

Steps taken so far:

(1) Deleted the .snap file located in the directory

<workspace-directory>\.metadata\.plugins\org.eclipse.core.resources

(2) Deleted tmp folder in the following directory

<workspace-directory>\.metadata\.plugins\org.eclipse.wst.server.core

(3) Clean project & server

(4) Reconfigured the server by deleting the current server, & adding new server

(5) Just to ensure changes to reflect, restarted Eclipse every time after performing above steps.

Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> coreservlets.ShowItems_ArrayList in servlet mapping
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3279)
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3254)
at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1430)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1344)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)
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:5355)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 6 more

然而,所有的提示和技巧似乎都白费了。

web.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">

<servlet>
<servlet-name>ShowItems_ArrayList</servlet-name>
<servlet-class>coreservlets.ShowItems_ArrayList</servlet-class>
</servlet>


<servlet-mapping>
<servlet-name>ShowItems_ArrayList</servlet-name>
<url-pattern>coreservlets.ShowItems_ArrayList</url-pattern>
</servlet-mapping>

</web-app>

最佳答案

您的网址格式不正确。它需要以斜杠开头。虽然不是完全重复,但请参阅此问题:

Why should url-pattern in servlet mapping start with forward slash(/)

关于eclipse - java.lang.IllegalArgumentException : Invalid <url-pattern> coreservlets. ShowItems_ArrayList 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29534673/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com