• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
  • Tim Holloway
  • Carey Brown
  • salvin francis

URLConnection throws EOFException

Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code snippet works fine when it is run as a standalone program on my Linux machine. When run as a servlet under tomcat 5, it throws: java.io.EOFException : unexpected end of input stream.

Now if I run it as a servlet on my Windows machine it works fine.

Tomcat 5.5
JVM : 1.4.2_11

Tomcat 5
JVM 1.4.2_05

The exception started happening after we installed a new Linux kernel including jvm and tomcat5. Could the different versions of jvm or tomcat (they are pretty close)be the problem, or do you think it is with Linux?

try {
URL u = new URL(serviceURL);
URLConnection connection = / u.openConnection();
InputStream is = connection.getInputStream();
return is;
} catch(Exception anything) {
You've gotta fight it! Don't give in! Read this tiny ad:
Enterprise-grade Excel API for Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!