levigo / jbig2-imageio

A Java ImageIO plugin for the JBIG2 bi-level image format
Apache License 2.0
31 stars 19 forks source link

Java 9 IllegalArgumentException #10

Closed simonsteiner1984 closed 8 years ago

simonsteiner1984 commented 8 years ago

Caused by: java.lang.IllegalArgumentException: com.levigo.jbig2.util.log.LoggerBridge is not an ImageIO SPI class at javax.imageio.spi.ServiceRegistry.checkClassAllowed(java.desktop@9-ea/ServiceRegistry.java:733)

ghost commented 8 years ago

Exception is simply true. Useless without further description.

simonsteiner1984 commented 8 years ago

java -cp levigo-jbig2-imageio-1.6.5.jar:pdf-box-svn/app/target/pdfbox-app-2.1.0-SNAPSHOT.jar org.apache.pdfbox.tools.PDFToImage sigice9_172.Adobe.pdf

pdf from https://issues.apache.org/jira/browse/PDFBOX-81

Exception in thread "main" java.lang.ExceptionInInitializerError at com.levigo.jbig2.JBIG2ImageReaderSpi.createReaderInstance(JBIG2ImageReaderSpi.java:118)

THausherr commented 8 years ago

Please reopen. Here's some more:

public class JDK9Test
{
    public static void main(String[] args) throws IOException
    {
        ImageIO.getImageReadersByFormatName("JBIG2").next();
    }
}

run this on JDK9 early access (you can build on a lower system), and this is the stack trace you'll get:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at com.levigo.jbig2.JBIG2ImageReaderSpi.createReaderInstance(JBIG2ImageReaderSpi.java:118)
    at javax.imageio.spi.ImageReaderSpi.createReaderInstance(java.desktop@9-ea/ImageReaderSpi.java:320)
    at javax.imageio.ImageIO$ImageReaderIterator.next(java.desktop@9-ea/ImageIO.java:529)
    at javax.imageio.ImageIO$ImageReaderIterator.next(java.desktop@9-ea/ImageIO.java:513)
    at javaapplication41createtiff.JDK9Test.main(JDK9Test.java:22)
Caused by: java.lang.IllegalArgumentException: com.levigo.jbig2.util.log.LoggerBridge is not an ImageIO SPI class
    at javax.imageio.spi.ServiceRegistry.checkClassAllowed(java.desktop@9-ea/ServiceRegistry.java:733)
    at javax.imageio.spi.ServiceRegistry.lookupProviders(java.desktop@9-ea/ServiceRegistry.java:228)
    at com.levigo.jbig2.util.ServiceLookup.getServices(ServiceLookup.java:31)
    at com.levigo.jbig2.util.log.LoggerFactory.getLogger(LoggerFactory.java:38)
    at com.levigo.jbig2.util.log.LoggerFactory.getLogger(LoggerFactory.java:50)
    at com.levigo.jbig2.JBIG2ImageReader.<clinit>(JBIG2ImageReader.java:49)
    ... 5 more
ghost commented 8 years ago

Travis CI does not yet support Java 9. The test will be done manually beside the usual CI. I opened a follow-up issue - see #17.

karussell commented 7 years ago

Sorry for posting here. I've not yet found this error elsewhere in the web. @THausherr or @krzikams did you found a solution for this problem on JDK9? We get this when we add geotools to our dependencies, see here: https://travis-ci.org/graphhopper/graphhopper/jobs/176670700

We've managed to setup a travis build which fetches JDK9 (maybe interesting for your #17), see here: https://github.com/graphhopper/graphhopper/pull/806

Sorry, it looks like you fixed your problem with #18, will see how we can use this information.