-----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(NativeConstructorA
> ccessorImpl.java:39)
>       at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
> tructorAccessorImpl.java:27)
>       at
> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>       at
> sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java
> :1240)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at
> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLC
> onnection.java:1234)
>       at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec
> 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.HUSim
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

Reply via email to