metadata - java.lang.ClassNotFoundException : com.adobe.xmp.XMPException -
i using metadata extractor extract metadata image file , working flawlessly until today morning today encountered exception
java.lang.classnotfoundexception : com.adobe.xmp.xmpexception and control of web application redirected error.jsp expected
also found article resolve exception
but code extract wrapped in try-catch block why exception didn't catched in catch block
entire stack trace :
caused by: java.lang.noclassdeffounderror: com/adobe/xmp/xmpexception @ com.drew.imaging.jpeg.jpegmetadatareader.extractmetadatafromjpegsegmentreader(jpegmetadatareader.java:112) @ com.drew.imaging.jpeg.jpegmetadatareader.readmetadata(jpegmetadatareader.java:71) @ com.drew.imaging.imagemetadatareader.readmetadata(imagemetadatareader.java:108) @ com.drew.imaging.imagemetadatareader.readmetadata(imagemetadatareader.java:95) @ mypackagename.myclassname.readlocationexifdata(myclassname.java:274) relevant code :
try{ metadata metadata = imagemetadatareader.readmetadata(file); --> line 274 gpsdirectory directory = metadata.getdirectory(gpsdirectory.class); gpsdescriptor descriptor = new gpsdescriptor(directory); } catch(exception e){ e.printstacktrace(); return null; } note : application in production , it's not easy add jar file , redeploy application
please run program , understand, had been throwable, have worked you.
program 1 - catch throwable
public static void main(string[] args) { try { throw new error(); } catch (throwable e) { system.out.println("hi"); } } output
hi program 2 - catch exception
public static void main(string[] args) { try { throw new error(); } catch (exception e) { system.out.println("hi"); } } output
exception in thread "main" java.lang.error program 3 - catch error
public static void main(string[] args) { try { throw new error(); } catch (error e) { system.out.println("hi"); } } output
hi
Comments
Post a Comment