0

Eclipse Version: Kepler Service Release 1

Build id: 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

However, all the tips & tricks seems to have gone in vain.

web.xml file:

<?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>
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
mindfreak
  • 456
  • 3
  • 9
  • 29

1 Answers1

0

Your url-pattern is not in the correct format. It needs to start with a slash. While not an exact duplicate, see this question:

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

Community
  • 1
  • 1
Necreaux
  • 9,451
  • 7
  • 26
  • 43