As I try to convert PDF to TIF via PDFBox in WebSphere 8, I got the error message during the conversion process:
Lacking of jai-imageio-core jar file in your classpath must get this error message.
But I have add jai-imageio-core dependency in pom.xml.
Snippet of pom.xml looks like:
Therefore, I try to print log to figure out the weird problem:
The jar file exists in my ear file ! What happened?
Here is my source code:
The root cause is not so clear. It may results from WebSphere's classloading problem.
Hence, I find an API to scans for plug-ins on the application class path, loads their service provider classes, and registers a service provider instance for each one found with the IIORegistry. This strange problem had been resolved as I add ImageIO.scanForPlugins();