I am using a project to manage MPT with Java.
I've got a piece of code like:
try {
originalfilename = m_allFiles[i].getOriginalFileName();
} catch (Exception e) {
System.out.println("Exception Caught");
}
As I access the objects from different threads, sometimes this instruction throws an exception like be.derycke.pieter.com.COMException
The message "Exception Caught" is never printed and console prints this stack trace:
be.derycke.pieter.com.COMException: Failed to retrieve the properties (0x800700aa)
at jmtp.PortableDevicePropertiesImplWin32.getValues(Native Method)
at jmtp.PortableDeviceObjectImplWin32.retrieveStringValue(Unknown Source)
at jmtp.PortableDeviceObjectImplWin32.getOriginalFileName(Unknown Source)
at com.servifot.kiosco.MobileCableSearcher$MobileFolderSearcher.run(MobileCableSearcher.java:284)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
The "MobileCableSearcher.java:284" line is what I have inside the try. So why the catch is not catching the exception?
The object which I call getOriginalFilename() is a PortableDeviceObject
I've tried to Catch a Throwable but the problem is exactly the same.
I've tried to specify the exception with be.derycke.pieter.com.COMException but I get this error:
Exception is caught and reported in PortableDeviceObjectImplWin32.retrieveStringValue
.
You will get null
as result of getOriginalFileName
in this case.
User contributions licensed under CC BY-SA 3.0