An illegal reflective access operation has occurred for thumbnails

Hi,

I just downloaded the latest version of Slides Java
I’m printing thumbnails from slides but getting this warning sometimes (quite often) :

thumbnails_worker_4  | WARNING: An illegal reflective access operation has occurred
thumbnails_worker_4  | WARNING: Illegal reflective access by com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.oracle.OracleJpegImageReader (file:/app/lib/aspose/jar/aspose-slides-21.1-jdk16.jar) to field com.sun.imageio.plugins.jpeg.JPEGImageReader.colorSpaceCode
thumbnails_worker_4  | WARNING: Please consider reporting this to the maintainers of com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.oracle.OracleJpegImageReader
thumbnails_worker_4  | WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

I’m basically generating the thumbnail this way :

slide = slides.get_Item(i)
  image = slide.getThumbnail(scale_x, scale_y)
  imageIO.write(image, javaString("jpg"), javaFile(thumbnail_path))

Is this something you guys can look into ?
I think you already fixed if for slides cloning, but looks like it’s also happening for thumbnails generation.

Thanks a lot !

@alb1

These are merely warnings and I hope they may not lead to errors. However, in order investigate them on our end, please provide the following information:

1: Used sample code
2: Source presentation
3: Java and Operating System details

Hi,

Yes it’s just a warning, but it’s cluttering the logs and I guess it might break someday in the future so I thought I’d forward it to you guys :slight_smile:

Here’s a slide to reproduce : Dropbox - File Deleted - Simplify your life

Code used to create the warnings below

>>> asposeLicense = jpype.JClass('com.aspose.slides.License')()
>>> asposeLicense.setLicense(licenseStr)
>>> file_location = "/data/slides_splitted/414fe497-143c-4874-a752-c96cef725781/fe0c4c88-901a-4443-bf51-544b513c4147.pptx"
>>> pres = asposePresentation(file_location)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.oracle.OracleJpegImageReader (file:/app/lib/aspose/jar/aspose-slides-21.1-jdk16.jar) to field com.sun.imageio.plugins.jpeg.JPEGImageReader.colorSpaceCode
WARNING: Please consider reporting this to the maintainers of com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.oracle.OracleJpegImageReader

Java version (running on Linux through docker containers) :

    root@229f6a28e406# java --version
    Picked up JAVA_TOOL_OPTIONS: -Xmx1g -Xms150m
    openjdk 11.0.8 2020-07-14 LTS
    OpenJDK Runtime Environment Zulu11.41+23-CA (build 11.0.8+10-LTS)
    OpenJDK 64-Bit Server VM Zulu11.41+23-CA (build 11.0.8+10-LTS, mixed mode)

Thanks !

@alb1

An investigation ticket with ID SLIDESJAVA-38460 has been created to further investigate the root cause and implication of warning messages shared by you. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

@alb1

We have investigated the specified warnings and their implications on our end. These warnings have been added to JDK since version 9. Please note that these are warnings, not errors. You can use the following JVM option to suppress these messages:
–add-opens (Java Platform, Standard Edition Oracle JDK 9 Migration Guide, Release 9)

Also, we like to clear things up about the usage of com.sun.imageio.plugins.jpeg. JPEGImageReader class. Actually, we use this class if it is available. We also have our own implementation JPEG image reader. But, due to the fact that JPEGImageReader has a little bit better performance, we use it. If JPEGImageReader is not available we use own implementation. Thus, if this class (JPEGImageReader) will be removed in future releases, it will not break down the Aspose.Slides functionality.

Sounds good, thanks ! :slight_smile:

@alb1

You are always welcome.

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