tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lataxes, Karl" <>
Subject RE: Unable to Access Servlet After Migrating From Tomcat 5.0.25 to 6.0.18
Date Fri, 04 Sep 2009 15:10:45 GMT

I tried your suggestion and replaced the trailing / in the url-pattern
of the servlet-mapping tag with *, but got the same result.  I even
tried commenting out servlet-mapping altogether, but still received the
file not found exception.

The HUSim class is part of an application that I wrote years back to
test servlet functionality, and it has worked up to and including
servlet deployment in 5.0.25.  I removed the trailing /, rebuilt the
application, and ran it again, with the same result.  I strongly believe
it may be a mapping issue, but I just can't seem to nail it down.


-----Original Message-----
From: Christopher Schultz [] 
Sent: Friday, September 04, 2009 10:42 AM
To: Tomcat Users List
Subject: Re: Unable to Access Servlet After Migrating From Tomcat 5.0.25
to 6.0.18

Hash: SHA1


On 9/4/2009 8:56 AM, Lataxes, Karl wrote:
> I am attempting to migrate a servlet from Tomcat 5.0.25 to 6.0.18, but

> my efforts to access it while running under 6.0.18 have been 
> unsuccessful.


> Here is the stack trace I received when running my server based 
> application to access the servlet:
> http://d1uap:4901/UMI/servlet/HUControlServlet/
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> 	at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructo
> rA
> 	at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCo
> ns
> 	at
> java.lang.reflect.Constructor.newInstance(
> 	at
> va
> :1240)
> 	at Method)
> 	at
> LC
> 	at
> ec
> 	at
> com.nielsenmedia.umi.ap.datacollection.test.homeunitsimulator.messages
> .H
> UStatus.sendStatus(
> 	at
> com.nielsenmedia.umi.ap.datacollection.test.homeunitsimulator.messages
> .H
> UInitConn.sendStatus(
> 	at
> com.nielsenmedia.umi.ap.datacollection.test.homeunitsimulator.drivers.
> HU
> Session.Process(
> 	at
> com.nielsenmedia.umi.ap.datacollection.test.homeunitsimulator.drivers.
> HU
> Sim.main(

I'm just guessing that
is your own class, right? Well, your code is definitely running. It's
trying to access the URL
"http://d1uap:4901/UMI/servlet/HUControlServlet/" using an
HttpURLConnection object.

It looks like your code isn't properly catching FileNotFoundException
(which really is a stupid exception for URLConnection to throw IMHO)
when the URL is not accessible.

Or do I have this wrong, and the exception is occurring in a driver
class you've written to access the server?

Could you post your <Connector> configuration from server.xml? What
happens when you telnet to d1uap:4901 ?

> Here is the localhost_access_log entry from the test that generated 
> the stack trace (servlet running on Tomcat 6.0.18).  As you can see, 
> it is generating an HTTP 404 error code:
> - - [03/Sep/2009:13:53:42 -0400] "POST 
> /UMI/servlet/HUControlServlet/ HTTP/1.1" 404 1042

That trailing slash doesn't look right. It looks like that's what your
code is requesting (it's up there in the exception) but you have mapped
this exact URI in your web.xml:

> 	<servlet-mapping>
> 		<servlet-name>HUControlServlet</servlet-name>
> 		<url-pattern>/UMI/servlet/HUControlServlet</url-pattern>
> 	</servlet-mapping>

The trailing slash is likely to be the problem. What happens if you make
the request without the trailing slash? Or, what happens if you change
your URI mapping to:


- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message