We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

IllegalAccessError: superclass access check failed

Having the attached sample test.zip (containing images) using the current version of aspose slides 21.6 with Java 16.0.1 (compiler level 1.8, 14 or 16) I run into the following exception:

	java.lang.IllegalAccessError: superclass access check failed: class com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.oracle.OracleJpegImageReader (in unnamed module @0x3a0baae5) cannot access class com.sun.imageio.plugins.jpeg.JPEGImageReader (in module java.desktop) because module java.desktop does not export com.sun.imageio.plugins.jpeg to unnamed module @0x3a0baae5
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1010)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:855)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:753)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:676)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:634)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:375)
	at com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.JpegImageReader.for(Unknown Source)
	at com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.JpegImageReader.if(Unknown Source)
	at com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.JpegImageReader.do(Unknown Source)
	at com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.JpegImageReader.do(Unknown Source)
	at com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.JpegImageReader.setInput(Unknown Source)
	at com.aspose.slides.internal.gv.do.do(Unknown Source)
	at com.aspose.slides.internal.fm.if.do(Unknown Source)
	at com.aspose.slides.internal.fm.if.<init>(Unknown Source)
	at com.aspose.slides.internal.fm.if.<init>(Unknown Source)
	at com.aspose.slides.internal.fm.class.do(Unknown Source)
	at com.aspose.slides.internal.fm.class.do(Unknown Source)
	at com.aspose.slides.internal.fm.class.do(Unknown Source)
	at com.aspose.slides.ImageCollection.do(Unknown Source)
	at com.aspose.slides.agz.new(Unknown Source)
	at com.aspose.slides.agz.do(Unknown Source)
	at com.aspose.slides.ag1.if(Unknown Source)
	at com.aspose.slides.ag1.do(Unknown Source)
	at com.aspose.slides.Presentation.if(Unknown Source)
	at com.aspose.slides.Presentation.do(Unknown Source)
	at com.aspose.slides.Presentation.if(Unknown Source)
	at com.aspose.slides.Presentation.<init>(Unknown Source)
	at com.aspose.slides.Presentation.<init>(Unknown Source)
	at aspose.slides.sandbox.SlidesApplication.main(SlidesApplication.java:37)

I use a very simple test application:

public class SlidesApplication {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			try (InputStream licenseStream = new FileInputStream(
					"D:/dev/repositories/sandbox/aspose.slides.sandbox/Aspose.Total.Java.lic")) {
				com.aspose.slides.License slidesLicense = new com.aspose.slides.License();
				slidesLicense.setLicense(licenseStream);
			}

			Locale.setDefault(new Locale("de"));

			String base = "issue3/";

			try (InputStream inputStream = new FileInputStream(base + "test.pptx")) {
				Presentation presentation = new Presentation(inputStream);
				presentation.save(base + "test2.pptx", SaveFormat.Pptx);
			}
		} catch (Throwable e) {
			e.printStackTrace();
		}
	}
}

I tried to narrow it down, the exception also happens with: aspose-slides-19.12-jdk16, aspose-slides-20.12-jdk16, aspose-slides-21.5-jdk16, aspose-slides-21.6-jdk16.
But does not happen with older version like: aspose.slides-15.8.0

@phe,
Thank you for the issue description. Unfortunately, I have not managed to reproduce the problem. Could you share a simple project, please?

aspose.slides.sandbox.zip (1.6 MB)

had to remove the aspose-slides-21.6-jdk16.jar due to upload limit.

@phe,
Thank you for the project example. I will answer you as soon as possible.

@phe,
I removed a license file from your ZIP file. Please do not share your license in the future. I added a ticket with ID SLIDESJAVA-38563 in our tracking system. Our development team will investigate this case. I will inform you of any progress.

@phe,
Our development team investigated the issue. As a workaround, you can add
--add-opens java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED
to JVM arguments.
A full fix will be available in Aspose.Slides 21.7.

The issues you have found earlier (filed as SLIDESJAVA-38563) have been fixed in this update.