GPT Read/Resample of S2 L2A problems in 5.0.4

In a GPT script from shell I would like to read a S2 L2A (generated with sen2cor 2.3.0) then resample it and further process it. To simplify things let take as an example that after resampling I write it as DIMAP format.
I am using SNAP5 updated as today (5.0.4).

If I give as input to the read operator a single granule e.g. S2A_USER_PRD_MSIL2A_PDMC_20151223T042837_R036_V20151222T095928_20151222T095928.SAFE\GRANULE\S2A_USER_MSI_L2A_TL_SGS__20151222T134701_A002607_T33TXF_N02.01\S2A_USER_MTD_L2A_TL_SGS__20151222T134701_A002607_T33TXF.xml
all goes well and no error occurs.

If I give as input the whole product e.g.
I get some errors and the process stops.
On Windows10 I obtain:

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
Error: org.esa.snap.utils.PrivilegedAccessor.setStaticValue(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
java.lang.NoSuchMethodError: org.esa.snap.utils.PrivilegedAccessor.setStaticValue(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
at org.esa.snap.utils.NativeLibraryUtils.registerNativePaths(
at org.esa.snap.utils.NativeLibraryUtils.registerNativePaths(
at org.esa.s2tbx.dataio.gdal.GDALInstaller.processInstalledDistribution(
at org.esa.s2tbx.dataio.gdal.GDALInstaller.installDistribution(
at org.esa.s2tbx.dataio.gdal.GDALInstaller.install(
at org.esa.s2tbx.dataio.gdal.activator.GDALPlugInActivator.start(
at org.esa.snap.runtime.Engine.informActivators(
at org.esa.snap.runtime.Engine.lambda$start$0(
at org.esa.snap.runtime.Engine.runClientCode(
at org.esa.snap.runtime.Engine.start(
at org.esa.snap.runtime.Engine.start(
at org.esa.snap.runtime.Launcher.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(
at com.exe4j.runtime.WinLauncher.main(
at com.install4j.runtime.launcher.WinLauncher.main(

I then tried to use the same script with GTP from SNAP4 and no error occurred.

This is my GPT script:

temp_S2_L2A_Graph_Subset.xml (1.2 KB)

Hello Giulio.

We’re working on this issue and a fix will be published as soon as possible.

Could you please upload the SNAP log file?
You can find it in the location C:\Users<your_accout>\AppData\Roaming\SNAP\var\log, it is named “messages.log”.

Attached all the messages.log I found in the mentioned folder.
log.7z (13.1 KB)

I just launched again the GPT script, before the copy.


Ok, in none of the log files you’ve attached I see the error from your first post.
Could you try to just execute GPT.exe from a command prompt to see if it is still present?

Hi kraftek,
I deleted all the existing logs and launched the GPT command.
The error still occurred, but the AppData\Roaming\SNAP\var\log folder remained void.
There can be another folder where the log is saved?

Hi kraftek,
any news on that?
I read some topics about problems with Anaconda/Sen2Cor and GDAL installation on Windows add did some tries in changing paths/versions but with no success. I furthermore tested it on a clean machine with only SNAP 5.0 installed
(and updated to 5.0.4) and it worked.

Currently the only workaround I found on my PC is to install SNAP 5.0.0 and to not update it.


Hi Giulio,

The update 5.0.5 that solves, among others, your issue, has been released.

Cosmin (kraftek).

Thank you for the information Cosmin.

Now it works!!