• 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
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

File Not Found Problem

 
Ranch Hand
Posts: 2038
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have posted to wrong queue should be Java General queue.

I am trying to delete a file from my Web app. I get this out put in the console even though I can take the path the code generates, place it in a browser Address prompt and the file opens okay.

[11/1/10 6:08:42:915 CDT] 00000023 ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet DeleteFileAttachment. Exception thrown : java.lang.IllegalArgumentException: Delete: no such file or directory: file:\\gvas400\www\apachedft\htdocs\QualityManagement\FAI_Scanned_Documents\FAI\2010\FAI0000775854.pdf
at com.FAIWebApp.connections.FileIndexerConnection.setAttachmentIndex(FileIndexerConnection.java:371)
at com.FAIWebApp.utils.DeleteFileAttachment.doGet(DeleteFileAttachment.java:42)

This is my file class code method.

 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you replace all the forward slashes with backslashes I presume you are using Windows. Am I right? Since you start with file://gvas400 instead of starting with a driver letter (like "C:\") the gvas400 is a network disk or the like? Have you tested that you can even reach it with java using the syntax you use?
 
Steve Dyke
Ranch Hand
Posts: 2038
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ilari Moilanen wrote:Since you replace all the forward slashes with backslashes I presume you are using Windows. Am I right? Since you start with file://gvas400 instead of starting with a driver letter (like "C:\") the gvas400 is a network disk or the like? Have you tested that you can even reach it with java using the syntax you use?



I use the http syntax to open the file for viewing. The gvas400 is an IBM iSeries Computer.
 
Ilari Moilanen
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using http syntax then why do you use backslashes?

Additionally I believe that it is defined in the syntax that the path should start with ("file://";) but you start the path with "file:\\". Since the xxxx:// part is part of the protocol and not of the actual path.

I might be wrong here of course.
 
Steve Dyke
Ranch Hand
Posts: 2038
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ilari Moilanen wrote:If you are using http syntax then why do you use backslashes?

Additionally I believe that it is defined in the syntax that the path should start with ("file://";) but you start the path with "file:\\". Since the xxxx:// part is part of the protocol and not of the actual path.

I might be wrong here of course.



If I leave the "/" as they are and not replace them with "\" I still get the smae result. Eventhough again placing the result file path still works fine in browser.

[11/1/10 8:02:52:270 CDT] 00000022 SystemOut O Step1: http://gvas400.webergv.weber-intranet/QualityManagement/FAI_Scanned_Documents/FAI/2010/FAI0000775854.pdf
[11/1/10 8:02:52:270 CDT] 00000022 SystemOut O Step2: http://gvas400.webergv.weber-intranet/QualityManagement/FAI_Scanned_Documents/FAI/2010/FAI0000775854.pdf
[11/1/10 8:02:52:270 CDT] 00000022 SystemOut O Step3: file://gvas400/www/apachedft/htdocs/QualityManagement/FAI_Scanned_Documents/FAI/2010/FAI0000775854.pdf
[11/1/10 8:02:52:270 CDT] 00000022 SystemOut O Step4: file://gvas400/www/apachedft/htdocs/QualityManagement/FAI_Scanned_Documents/FAI/2010/FAI0000775854.pdf
[11/1/10 8:02:52:270 CDT] 00000022 ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet DeleteFileAttachment. Exception thrown : java.lang.IllegalArgumentException: Delete: no such file or directory: file://gvas400/www/apachedft/htdocs/QualityManagement/FAI_Scanned_Documents/FAI/2010/FAI0000775854.pdf
at com.FAIWebApp.connections.FileIndexerConnection.setAttachmentIndex(FileIndexerConnection.java:372)
at com.FAIWebApp.utils.DeleteFileAttachment.doGet(DeleteFileAttachment.java:42)
 
Ilari Moilanen
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I could not help you here. I'm not used to using the http syntax with local files.
If I would be using windows files I would do it either with

or with

that both work... The \\ is used because otherwise the String is illegal (you do not have that problem since you create the path programmatically)

The http does require that the syntax is "file://"; so you could try with

or with

or with
But I do not guarantee that they work.
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic