File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes URLConnection returning EmptyInputStream after tomcat upgrade (5 to 6) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "URLConnection returning EmptyInputStream after tomcat upgrade (5 to 6)" Watch "URLConnection returning EmptyInputStream after tomcat upgrade (5 to 6)" New topic
Author

URLConnection returning EmptyInputStream after tomcat upgrade (5 to 6)

Asad Imtiaz
Greenhorn

Joined: Aug 01, 2008
Posts: 21
Hi everyone,

I am facing an unusual issue. I have recently upgraded my tomcat version from 5 to 6. My application runs fine but I have an applet in one of my application (App1). From this applet it creates a URLConnection to another application (App2) running in the same tomcat. When an attempt is made to get the input stream using the connection object I can see that it returns a sun.net.www.protocol.http.EmptyInputStream. Where as the same code in running inside tomcat 5 returns the correct HTTP stream.

Please note that the upgrade was from tomcat 5 to 6 and java 1.4 to 6. The client is still running the applet on the Java 1.4 environment i.e. nothing has changed on the client side. The issue is kinda tied to my upgrade because when i fire up the Tomcat 5 the app runs as expected and if i switch to Tomcat 6 it fails on the mentioned applet.

Any points would be really helpful. I am quite frustrated and have lost direction. If you require any information please ask I will try to provide you as much as possible

Thanks & Regards
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16095
    
  21

The implication is that the servlet sends a request to the server, the server is returning an empty response.

One reason that I like to do these type of communications using text-based protocols is that I can cut the servlet out of the equation and make the request via a more interactive tool such as telnet.

Failing that, however, you need to examine what's happening on the server when the servlet's request comes in. First check the logs for possible exceptions, then trace the corresponding request-handling code. Once you have determined where and why the webapp isn't returning any data we can help you fix it.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: URLConnection returning EmptyInputStream after tomcat upgrade (5 to 6)