Chris,

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.

Karl

-----Original Message-----
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Karl,

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.

[snip]

> Here is the stack trace I received when running my server based 
> application to access the servlet:
> 
> java.io.FileNotFoundException:
> http://d1uap:4901/UMI/servlet/HUControlServlet/
>       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>       at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructo
> rA
> ccessorImpl.java:39)
>       at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCo
> ns
> tructorAccessorImpl.java:27)
>       at
> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>       at
> sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.ja
> va
> :1240)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at
> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpUR
> LC
> onnection.java:1234)
>       at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConn
> ec
> tion.java:921)
>       at
> com.nielsenmedia.umi.ap.datacollection.test.homeunitsimulator.messages
> .H
> UStatus.sendStatus(HUStatus.java:104)
>       at
> com.nielsenmedia.umi.ap.datacollection.test.homeunitsimulator.messages
> .H
> UInitConn.sendStatus(HUInitConn.java:95)
>       at
> com.nielsenmedia.umi.ap.datacollection.test.homeunitsimulator.drivers.
> HU
> Session.Process(HUSession.java:431)
>       at
> com.nielsenmedia.umi.ap.datacollection.test.homeunitsimulator.drivers.
> HU
> Sim.main(HUSim.java:311)

I'm just guessing that
com.nielsenmedia.umi.ap.datacollection.test.homeunitsimulator.drivers.HU
Sim
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:
> 
> 10.38.164.58 - - [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:

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

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqhJygACgkQ9CaO5/Lv0PD+owCghZFjel33q2anejx6BzvDpkE5
r+cAnA93bbfqqLk24fisYd01p/NxQuvg
=ZxOF
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to