Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Not able to create image.

Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friend,

Following is my machine environment:
JDK: 1.5
Struts: 2.0
Tomcat: 5.5
OS: Linux

I want to create a thumbnail from image. Entire logic for it is clear. I have runned same application on Windows platform, it is working fine & gives no error.
But of the application is deployed on Linux platform, it throws exception.

Following is the logic:

1. I create a file object with string input containing path.
2. I have taken another varible of BufferedImage
Code :

BufferedImage image =;

While creating this ojbect it gives me Exception as

javax.imageio.IIOException: Can't read input file!

Since file is created, there is not problem in path.
Then why is it giving me exception, instead it gives prefect output on windows platform.

Can any one sort out this problem.
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the string input you are using to create the file object?

You should not use any "/" or "\" characters for the path. You need to use File.separator instead.
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, make sure that you are not including a drive letter such as "c:\" in your path. There is no such thing as a drive letter in LINUX.
Attractive, successful people love this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic