Bug 492 - Exception on wildcard URL servlet mapping BugRat Report#823
Summary: Exception on wildcard URL servlet mapping BugRat Report#823
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 3
Classification: Unclassified
Component: Servlet (show other bugs)
Version: 3.2.x Nightly
Hardware: All All
: P1 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-01-23 08:57 UTC by Georg von Zezschwitz
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomcat Developers Mailing List 2001-01-23 08:57:29 UTC
I am unable to use tomcat 3.2.1 with PathInfo and Servlets. I 
tried with Apache and the mod_jserv-Connector (from 
Tomcat 3.2.1).

When specifing a servlet mapping like

..
 <servlet-name>net.xx.yy.myservlet</servlet-name>
 <url-pattern>/servlet/net.xx.yy.myservlet</url-pattern>
..

in web.xml I get a 404 from Tomcat when accessing URLs
like
   /servlet/net.xx.yy.myservlet/anyinformation

When specifing a mapping like 

..
 <servlet-name>net.xx.yy.myservlet</servlet-name>
 <url-pattern>/servlet/net.xx.yy.myservlet/*</url-pattern>
..
 
the response is like this:

Internal Servlet Error:

java.lang.IllegalStateException: Can't happen - classname is null, who added this ?
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.(Compiled Code)
        at java.lang.Exception.(Compiled Code)
        at java.lang.RuntimeException.(Compiled Code)
        at java.lang.IllegalStateException.(Compiled Code)
        at org.apache.tomcat.core.ServletWrapper.loadServlet(Compiled Code)
        at org.apache.tomcat.core.ServletWrapper.init(Compiled Code)
        at org.apache.tomcat.core.Handler.service(Compiled Code)
       ....

As I guess every time a program says "this can't happen"
a bug is involved, I felt invited to report it like
this.

Regards,


Georg
Comment 1 Costin Manolache 2001-02-01 11:59:52 UTC
With the first mapping - that's exactly what should happen, it's a clear
404 ( you do an exact mapping, it doesn't match ).
With the second, again it's an error - the servlet must be declared first
with servlet name and servlet class and _then_ use the servlet name. Tomcat
has a workaround ( if the servlet class is not declared, it'll use the name ), 
but it'll still warn. ( the class name is null - probably we need a better
message )