-
1. Re: Directory path in Windows
kragoth May 31, 2011 7:52 PM (in response to rkimiti)Put a breakpoint where it fails and make sure it is doing what you think it is doing. Most of the time I find out that I've missed something really simple and that's why your getting the error. Either of the paths should work if everything else is right.
-
2. Re: Directory path in Windows
rkimiti Jun 2, 2011 12:05 PM (in response to rkimiti)Thanks Tim for your contribution.
This is still giving me nightmares.
The same code is working ok when hosted on linux, but it is not working on Windows. -
3. Re: Directory path in Windows
rogermorituesta.rogermori.yahoo.com Jun 2, 2011 12:34 PM (in response to rkimiti)Try this pathname:
//C:/opt/pearltx/reports/obj
Roger.
-
4. Re: Directory path in Windows
rkimiti Jun 7, 2011 4:27 AM (in response to rkimiti)Hi Roger,
I appreciate your contribution.
But it is also not working. Incidentally, all the three paths/strings are giving the same error message.
I wonder what could be wrong with Windows, it is so smooth on linux.More suggestions are welcome.
Kind Regards,
Robert. -
5. Re: Directory path in Windows
jaikiran.jai_forums2005.yahoo.co.in Jun 7, 2011 4:50 AM (in response to rkimiti)Please post the entire exception stacktraces. Those might give us a hint.
-
6. Re: Directory path in Windows
jaikiran.jai_forums2005.yahoo.co.in Jun 7, 2011 4:51 AM (in response to rkimiti)And yes, even the relevant code where you are opening/writing these files.
-
7. Re: Directory path in Windows
rkimiti Jun 7, 2011 5:58 AM (in response to rkimiti)Hi Jaikiran,
I have the following settings for directories:
//Reports parameters
//public static String repObj = "/opt/pearltx/reports/obj/";
public static String repObj = "//C:/opt/pearltx/reports/obj/";
//public static String repDest = "/opt/pearltx/reports/dest/";
public static String repDest = "//C:/opt/pearltx/reports/dest/";
//Resources parameters
//public static String contactResource = "/opt/pearltx/resources/contact/";
public static String contactResource = "//C:/opt/pearltx/resources/contact/";
//Image parameters
//public static String contactImage = "/opt/pearltx/resources/contact_photo/";
public static String contactImage = "//C:/opt/pearltx/resources/contact_photo/";
The obj is where I have my .jasper files, and the .jrprint generated is also temporarily saved here.
The dest is where I am saving the exported file in .pdf or other formats.
To avoid collision in file names, time stamp is being added to the original filename before saving. This is working perfectly in linux, not unless the strings could have differences from linux to windows.But windows is not completing the process even where it generates its own timestamp.
I have a file student\Transcript.jasper
The creating a .jrprint from it, and the subsequent .pdf yields the following errors in Windows:
2011-06-07 12:17:48,278 INFO [com.parlor.express.action.reports.ReportSetup] (http-192.168.1.16-8080-1) Error saving file : C:\opt\pearltx\reports\obj\student\Transcript2011-06-07 12:17:39.869.jrprint
2011-06-07 12:17:48,801 INFO [com.parlor.express.action.reports.ReportSetup] (http-192.168.1.16-8080-1) java.io.FileNotFoundException: C:\opt\pearltx\reports\obj\student\Transcript2011-06-07 12:17:39.869.jrprint
In uploading a user photo. A user with id - 11762, and a filename m20.jpeg, and addint a timestamp to these:
When I upload, I log the generated filename as follows:
2011-06-07 12:29:52,179 INFO [com.parlor.express.action.files.ImageAction] (http-192.168.1.16-8080-1) C:\opt\pearltx\resources\contact_photo\11762_2011-06-07 12:29:52.179m20.jpeg
It eventually gives the following error:
2011-06-07 12:29:52,180 INFO [com.parlor.express.action.files.ImageAction] (http-192.168.1.16-8080-1) C:\opt\pearltx\resources\contact_photo\11762_2011-06-07 12:29:52.179m20.jpeg (The filename, directory name, or volume label syntax is incorrect)
In uploading a file, Financial.txt, associated with the user I get the following error:
2011-06-07 12:31:44,255 INFO [com.parlor.express.action.files.UploadHandler] (http-192.168.1.16-8080-3) C:\opt\pearltx\resources\contact\11762_2011-06-07 12:31:44.253Financial.txt (The filename, directory name, or volume label syntax is incorrect)
which means the file is not saved
Other than the update on the directory string, the it works very well in linux.
Kind Regards,
Robert. -
8. Re: Directory path in Windows
jaikiran.jai_forums2005.yahoo.co.in Jun 7, 2011 2:05 PM (in response to rkimiti)Your file name has characters which aren't permitted by Windows. For example
<blockquote>
_Robert Kimiti wrote on Jun 07, 2011 05:58:_<br/>
2011-06-07 12:29:52,180 INFO [com.parlor.express.action.files.ImageAction] (http-192.168.1.16-8080-1) C:\opt\pearltx\resources\contact_photo\11762_2011-06-07 12:29:52.179m20.jpeg (The filename, directory name, or volume label syntax is incorrect)
</blockquote>
You use 12:29:52 as part of the file name but the character : isn't allowed for a file name.
See this for conventions and restrictions on file names in Windows http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx#naming_conventions -
9. Re: Directory path in Windows
rkimiti Jun 8, 2011 9:39 AM (in response to rkimiti)Wow,
Thanks a lot, Jaikiran.
I will try your solution.
Incidentally I had been able to transfer the files that had already been generated on linux, but they were not accessible on Windows.
.replace(":", "_") will come to my rescue, if this is the case, when generating the file name.
Thanks once again.
Kind Regards,
Robert. -
10. Re: Directory path in Windows
rkimiti Jun 13, 2011 5:16 AM (in response to rkimiti)Happy to report that the .replace() solution worked.
Thanks a lot, Jaikiran.