Metawerx Java Hosting Small Logo

Debug Your App - javax.servlet.IllegalArgumentException

This page shows errors where an java.lang.IllegalArgumentException exception is thrown and how to fix them.

Table of Contents

java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name SomeServletName

Submitter: Neale Rudd
SEVERE: Parse error in application web.xml file at jndi:/127.0.0.1/WEB-INF/web.xml
java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name SomeServletName
        at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2719)
        at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2745)
        at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1060)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endNamespaceScope(XMLDTDValidator.java:2077)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2028)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:901)
	...

This error occurs in the following situations:

  • your web.xml file has a <servlet-mapping> with no matching <servlet>. Each mapping must include a <servlet-name> that matches a <servlet-name> in a <servlet> element.
  • your web.xml file has a correctly matched servlet-mapping and servlet element, but the servlet-mapping appears before the servlet. The servlet-mapping must appear below the servlet, because the file is parsed in order.

java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name SomeFilterName

Submitter: Neale Rudd
11/01/2007 18:30:49 org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml file at jndi:/127.0.0.1/WEB-INF/web.xml
java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name SomeFilterName
        at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2719)
        at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2745)
        at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1060)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endNamespaceScope(XMLDTDValidator.java:2077)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2028)
        at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:901)
        ...

This error occurs in the following situations:

  • your web.xml file has a <filter-mapping> with no matching <filter>. Each mapping must include a <filter-name> that matches a <filter-name> in a <filter> element.
  • your web.xml file has a correctly matched filter-mapping and filter element, but the filter-mapping appears before the filter. The filter-mapping must appear below the filter, because the file is parsed in order.

Comments

Hello,

I'm new to using exadel studio pro running eclipse plugin. I am trying to view a web application in my browser. After the build is successful, I start Tomcat and I receive the following error:

SEVERE: Error starting static Resources

java.lang.IllegalArgumentException: Document base C:\Documents and Settings\carmen\USER_Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\USER-UI does not exist or is not a readable directory

SEVERE: Error starting static Resources

java.lang.IllegalArgumentException: Document base C:\Documents and Settings\carmen\USER_Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\USER-QM does not exist or is not a readable directory

For this particular application, I am using subversion for source control (I used to CVS). In other applications, I could fix this error by going into my webcontent folder of the application and copying and pasting all the files into the \.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\APPNAME. That would fix it. However, I don't have the APPNAME folder in my .metadata files with this application and I don't know why it's not or how to put it in there, or if it is needed to fix this.

Does anyone have a solution to this? If so, could you describe the solution in steps?

Thanks in advance.

CA

--Carmen, 23-Jun-2007


Hi Carmen,

This looks like a permissions error, or an actual missing directory where Eclipse is trying to write temporary files or save a project. Have you tried checking if the folder specified in the error actually exists, and if not, then creating it yourself?

--Neale, 23-Jun-2007


Thanks Neale, for your fast response.

I am the admin on my machine and I checked permissions -- right-click on START (on the taskbar) -- Explore All Users, is that correct way to check for permissions?

Yes, the directory where Eclipse wants to write the temporary files is missing. Was eclipse supposed to create that? If that works, I won't have to do a build all the time to unit test my code. I could just copy and paste those files appropriately and do a "refresh" in my browser to see my changes.

How do I create the directory myself? Should I:

1. Make a new directory called USER-UI (same name) in the \.metadata\.plugin\ etc...

2. Copy all the files in my USER-UI webcontent folder in c:\documents and settings\user\USER_Workspace directory

3. Then paste into the new temporary folder in C:\Documents and Settings\carmen\USER_Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\webapps\ directory?

Thanks in advance, Carmen

--Carmen, 23-Jun-2007


Hi Carmen,

To tell you the truth I'm not too familiar with Eclipse, so I think you would have to just create the folder and see what happens (item 1). If you don't get the expected result, try copying the files in as per your items 2 and 3 above and see if that has the desired effect.

The permissions should be fine, it looks like the problem is just a missing folder.

--Neale, 24-Jun-2007


Hi Neale: Really love what you've done with your jspwiki installation. Noticed that there seems to be some extra unwanted letters on the top of the page. Check the recent September?? emails concerning spam attacks causing this in the JSPwiki forum if this is new to you.

Claudia Frers Oct 4, 2007


Thanks Claudia, will do. This is becoming annoying recently. I have a few ideas on how it can be stopped as well.

--Neale, 15-Oct-2007

navigation
metawerx specific
search
Share
tools
help

referring pages

Share