I need some help i am working on backup and restoring sqlite.db file , In this process i store a copy of db file in my device storage and restore it from there which is working perfectly fine. But when i send this file through any email server like gmail and download it into my storage it add timestamp to its name i handled that in code but it says file not found exception ,i guess gmail is not downloading it properly in storage or not giving access to other apps .
Whenever i rename that file just replacing any alphabet from that name than i can restore that file please help me out i am stuck here ,Thanks in advance
I have found the solution :
My problem was when a file is downloaded from gmail or any other server when we try to get its path it does not give its actual path it give path like /downloads/#2386
so when i try to open it, it shows file not found exception so to overcome this problem i have to get actual file path from that path, after getting that path and try to open it, it works perfectly fine.
Related
When I am trying to run a Jasper Report,it is giving me this error.I am using this Jasper reports in adempiere technology.
-----------> ReportStarter.ejbGetRemoteMD5: Unable to create jndi context did you deployed webApp.ear package?
Remote hashing is impossible
12:21:15.496 ReportStarter.httpDownloadedReport: MD5 for local file is Cv0/FrUANvGZq2xkmOi1zA
-----------> ReportStarter.httpDownloadedReport: Remote hashing is not available did you deployed webApp.ear?
-----------> ReportStarter.getRemoteFile: 404 not found: Report cannot be found on server http://[Server PC IP Address]:4911/CustomReports/barcodePrint.jasper
12:21:15.541 ReportStarter.httpDownloadedReport: report on server is different that local one, replacing
Please tell me what to do,so as to solve this error.I tried to google it, but not getting it.
First of all, give path to the .jrxml file not the .jasper file .
Also in order to check that the path you entered is correct you can, copy paste the path on go to URL bar in chrome and check whether is generates and XML file. If it generates an XML file on chrome the path is correct and then you can move ahead.
P.S Check the path once the server is started.
I created a maven project which is bundle in Apache ServiceMix now.
Now i want to add html file to this project and print somethink on it.
How to do it? I try do this but when i want to open index.html i got an error:
URI u = new URI("/MyCommands/src/main/webapp/index.html");
Couldn't find file - in karaf console.
i tried URI u = new URI("index.html"); to, but it didnt work.
Please help me :(
Error log
Ok I guess you only need to specify the path correctly and judging from your project structure you need:
URI u = new URI("src/main/webapp/index.html");
The path /MyCommands/src/main/webapp/index.html that gives you the error signifies an absolute path in your machine. Does this correspond to your actual folder structure?
If you wanted a relative path (beginning from your source root folder you should not use the first forward slash /, something like MyCommands/src/main/webapp/index.html but in your case I think MyCommands/ is unnecessary.
Edit:
Copying from the Class Desktop documentation for browse() method :
IOException - if the user default browser is not found, or it fails to
be launched, or the default handler application failed to be launched
Judging from the above maybe you should check if your browser has some problem launching.
Can you open anyother URI instead of the one specified for example?
I am probably doing something stupid here but my app cannot read data from the external storage. But i can write files just fine. In fact, i pull the files from an FTP server and write them to external storage which works fine. But as soon as I try to read them with:
getApplicationContext().openFileInput(files[i]);
I get java.io.FileNotFoundException: /data/data/co.za.infestation.opendesign.app/files/event1.txt: open failed: ENOENT (No such file or directory)
Which is weird because I know the files are there. And i know files[i] has the correct file name because I printed them before after:
String[] files = getExternalFilesDir(null).list();
Yes I did add the permissions in the manifest file... And yes, i did hardcode the file names without success..Maybe i need more coffee.
Thanks!
openFileInput()
is for opening files which reside in private internal memory. You can see the error path:
/data/data/co.za.infestation.............
Try to open with a
FileInputStream()
instead.
I have created a web service which will query the data base and save the file to a specific location. I have tested the code in the local system and its working fine. But when I am trying to put the code in the server it is showing file not found exception.
Below is the piece of code that I am running:
FileInputStream fileInputStream = new FileInputStream("D:\\ram_sahu/Hello.csv");
Could you guys please help me in this.
Thanks,
Ram
The problem is that you have an absolute path for the file which 'points' to the location of the file locally.
You need to put the path according to where it will be in the server.
I have created an app using javaCv and
I'm trying to save an image in android using
cvSaveImage("/storage/sdcard0/watermarked/test.jpg", yCrCb);
cvSaveImage("/storage/extSdCard/test.jpg",yCrCb);
where yCrCb is an IplImage.
There is no exception error and the program runs smoothly but the files are not saved into the path as mentioned above.
I would like to ask what might be the possible problems ? is it the naming convention of the file name ?
If it helps, I have a java application counterpart of this app and the java version works fine when i use the line
cvSaveImage("C:\\testing123.jpg", yCrCb);
Hi I have used same thing for storing the image.
For getting the path to sdcard, I have used the Environment.getExternalStorageDirectory().toString();
append the folder name to this path where you want to store the image
try this and also make sure that you have written permission in the xml file.