Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 9 IllegalArgumentException #10

Closed
simonsteiner1984 opened this issue Apr 12, 2016 · 5 comments
Closed

Java 9 IllegalArgumentException #10

simonsteiner1984 opened this issue Apr 12, 2016 · 5 comments
Labels
Milestone

Comments

@simonsteiner1984
Copy link

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 ghost closed this as completed Apr 12, 2016
@ghost
Copy link

ghost commented Apr 12, 2016

Exception is simply true.
Useless without further description.

@simonsteiner1984
Copy link
Author

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
Copy link

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 ghost reopened this Apr 29, 2016
@ghost ghost self-assigned this May 6, 2016
@ghost ghost added this to the 2.0.0 milestone May 6, 2016
@ghost ghost added the bug label May 6, 2016
ghost pushed a commit that referenced this issue May 6, 2016
Java 9 compiler doesn't support source and target level Java 5 (1.5) anymore. Java 6 (1.6) is deprecated. This commit lifts the source and target configuration to Java 7 (1.7). Releasing this breaks support of Java 6 and below. (issue #10)
ghost referenced this issue May 6, 2016
Lift source and target configuration of maven-compiler-plugin
@ghost
Copy link

ghost commented May 6, 2016

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.

ghost pushed a commit that referenced this issue May 6, 2016
In Java 9, `javax.imageio.spi.ServiceRegistry` checks if the requested service is an implementation of the Image I/O service provider interface. This module used the Image I/O service registry for loading external utility services like logging and caching. This is not an intended use and is now prohibited by the Java 9 runtime. `javax.imageio.spi.ServiceRegistry` uses 'java.util.ServiceLoader' internally.

The lookups done by `javax.imageio.spi.ServiceRegistry` are replaced by that of 'java.util.ServiceLoader'. This fixes issue #10.
ghost referenced this issue May 6, 2016
…h-ServiceLoader-#10

Use general service loading instead of Image I/O-specific
@ghost ghost closed this as completed May 6, 2016
@karussell
Copy link

karussell commented Nov 17, 2016

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: graphhopper/graphhopper#806

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

@ghost ghost mentioned this issue Jun 2, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants