Win a copy of Pipeline as Code this week in the Cloud/Virtualization 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

java.io.filenotfoundexception

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
When i try to upload document from the client machine i am getting java.io.FilenotfoundException .I used struts 2.0 for my web application and tomcat application server. Kindly help me

Regards
Kiran
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kindly show us the code where the exception is thrown! (Don't forget to use code tags!)
 
kiran chirravuru
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
I am not getting any exception when i run locally but when i run the web application on the remote tomcat application server as a service then i am getting java.io.FilenotfoundException. The following is the code which i have used in the action class in struts 2.0

File srcfile = new File(srcfile path)----> this is the uploaded file path.
Then when i check for the existence of the file it gives error message that the file does not exist.

File desfile = new File(despath)-----> destination Path where i store my file.
Inputstream in = new Fileinputstream(srcfile)
byte[] arr = new byte[1024]
in.read(byte) ----> Here it gives file not found exception when i try to read the file.


I am not able trace the problem

Kindly help me it is major issue
 
I just had the craziest dream. This tiny ad was in it.
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic