WARNING: An illegal reflective access operation has occurred

Trying to run the following code in Python 3.4 in order to calibrate a GRD sentinel-1 product:

polarisation = ‘VV’

data_path = r’C:\Users\DMZ\shipdetection\mask’

s1_identifier = ‘S1B_IW_GRDH_1SDV_20161207T170908_20161207T170933_003293_0059D9_A666’

s1meta = “manifest.safe”

s1prd = os.path.join(data_path, s1_identifier, s1_identifier + ‘.SAFE’, s1meta)

reader = ProductIO.getProductReader(“SENTINEL-1”)
product = reader.readProductNodes(s1prd, None)

parameters = HashMap()
parameters.put(‘auxFile’, ‘Product Auxiliary File’)
parameters.put(‘outputImageInComplex’, ‘false’)
parameters.put(‘outputImageScaleInDb’, ‘false’)
parameters.put(‘createGammaBand’, ‘false’)
parameters.put(‘createBetaBand’, ‘false’)
parameters.put(‘selectedPolarisations’, polarisation)
parameters.put(‘outputSigmaBand’, ‘true’)
parameters.put(‘outputGammaBand’, ‘false’)
parameters.put(‘outputBetaBand’, ‘false’)

calibration = GPF.createProduct(‘Calibration’, parameters)

filepath = os.path.join(data_path, ‘cal_’ + s1_identifier + ‘_’ + polarisation +’.tif’)

ProductIO.writeProduct(calibration, filepath, ‘GeoTIFF’)

Unexpectedly I get the following output:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.esa.snap.runtime.Engine (file:/C:/Program%20Files/snap/s3tbx/modules/ext/org.esa.s3tbx.s3tbx-c2rcc/org-esa-snap/snap-runtime.jar) to field java.lang.ClassLoader.sys_paths
WARNING: Please consider reporting this to the maintainers of org.esa.snap.runtime.Engine
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
SEVERE: org.esa.s1tbx.io.SARReader: org.esa.s1tbx.io.sentinel1.Sentinel1ProductReader

Is there problems with the JDK or Java version?

Are you letting snap and snappy run with Java 9 or 10?
If so, yes you can get this warning messages regarding the access of java.lang.ClassLoader.sys_paths . But SNAP was developed for Java 8 and it is better to stick to it till we upgrade.

However, it should still work.
See also here: https://docs.oracle.com/javase/9/migrate/toc.htm#JSMIG-GUID-7BB28E4D-99B3-4078-BDC4-FC24180CE82B

I’m not sure about the last line

SEVERE: org.esa.s1tbx.io.SARReader: org.esa.s1tbx.io.sentinel1.Sentinel1ProductReader

This looks more serious. But I don’t know where it comes from. Could also be caused by the usage of Java 9/10.
Is your script working or does it fail?

Maybe @lveci can have look at this?

It does fail. Using newest Java 10

Should I downgrade both JDK and Java?

I would suggest it. Better stick to what we’ve delivered and tested.

Now the output reduces to

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
SEVERE: org.esa.s1tbx.io.SARReader: org.esa.s1tbx.io.sentinel1.Sentinel1ProductReader

Whole output:

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
SEVERE: org.esa.s1tbx.io.SARReader: org.esa.s1tbx.io.sentinel1.Sentinel1ProductReader
[input=path\S1B_IW_GRDH_1SDV_20161207T170908_20161207T170933_003293_0059D9_A666\S1B_IW_GRDH_1SDV_20161207T170908_20161207T170933_003293_0059D9_A666.SAFE\manifest.safe]:
path\S1B_IW_GRDH_1SDV_20161207T170908_20161207T170933_003293_0059D9_A666\S1B_IW_GRDH_1SDV_20161207T170908_20161207T170933_003293_0059D9_A666.SAFE\manifest.safe not found
Traceback (most recent call last):
File “path”, line 40, in
product = reader.readProductNodes(s1prd, None)
RuntimeError: java.io.IOException: org.esa.s1tbx.io.sentinel1.Sentinel1ProductReader
[input=path\S1B_IW_GRDH_1SDV_20161207T170908_20161207T170933_003293_0059D9_A666\S1B_IW_GRDH_1SDV_20161207T170908_20161207T170933_003293_0059D9_A666.SAFE\manifest.safe]:
path\S1B_IW_GRDH_1SDV_20161207T170908_20161207T170933_003293_0059D9_A666\S1B_IW_GRDH_1SDV_20161207T170908_20161207T170933_003293_0059D9_A666.SAFE\manifest.safe not found

After downgrading to JDK 8 and Java 8

It seems that the path to the S1 data is not correct.
I don’t see ‘C:\Users\DMZ\shipdetection\mask’ what you have configured in your script. Instead there is path

Oh I manually removed it to make it less chaotic