jaeksoft/opensearchserver

pdf viewer using deprecated class

kcfez opened this issue · 1 comments

kcfez commented

Can this be easily fixed so that I do not have to revert to an old JAVA using https://docs.oracle.com/javase/7/docs/api/javax/imageio/ImageIO.html ?

com.sun.image.codec.jpeg was removed from Java 7 onwards!
https://stackoverflow.com/questions/1906673/import-com-sun-image-codec-jpeg/1907060#1907060

Synopsis of error log.
http://..../viewer.zul?h=754869001&p=0
message Error reading 'currentImage' on type com.jaeksoft.searchlib.web.controller.ViewerController at [file:/home/jowett/opensearchserver/server/ROOT/viewer.zul, line:32]
org.zkoss.zel.ELException: Error reading 'currentImage' on type com.jaeksoft.searchlib.web.controller.ViewerController
java.lang.NoClassDefFoundError: com/sun/image/codec/jpeg/JPEGImageDecoder
java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.JPEGImageDecoder

java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

Links during investigation
https://javadoc.io/static/com.jaeksoft/opensearchserver/1.5.14/overview-summary.html
https://stackoverflow.com/questions/8015291/how-to-replace-com-sun-image-codec-jpeg-jpegimageencoder-in-this-code
https://stackoverflow.com/questions/24166056/java-jpg-codec-wont-work
https://javadoc.io/static/com.jaeksoft/opensearchserver/1.5.14/com/jaeksoft/searchlib/web/controller/ViewerController.htmlcom.jaeksoft.searchlib.web.controller.ViewerController.getCurrentImage(ViewerController.java:438)
https://javadoc.io/static/com.jaeksoft/opensearchserver/1.5.14/com/jaeksoft/searchlib/web/controller/ViewerController.html#getCurrentImage--

kcfez commented

I have this issue when using Debian java.vm.version 11.0.12+7-post-Debian-2deb10u1 but do not have the issue using 11.0.11+9-Ubuntu-0ubuntu2.20.04