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.
S2A_USER_PRD_MSIL2A_PDMC_20151223T042837_R036_V20151222T095928_20151222T095928.SAFE\S2A_USER_MTD_SAFL2A_PDMC_20151223T042837_R036_V20151222T095928_20151222T095928.xml
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(NativeLibraryUtils.java:56)
at org.esa.snap.utils.NativeLibraryUtils.registerNativePaths(NativeLibraryUtils.java:34)
at org.esa.s2tbx.dataio.gdal.GDALInstaller.processInstalledDistribution(GDALInstaller.java:126)
at org.esa.s2tbx.dataio.gdal.GDALInstaller.installDistribution(GDALInstaller.java:112)
at org.esa.s2tbx.dataio.gdal.GDALInstaller.install(GDALInstaller.java:84)
at org.esa.s2tbx.dataio.gdal.activator.GDALPlugInActivator.start(GDALPlugInActivator.java:32)
at org.esa.snap.runtime.Engine.informActivators(Engine.java:222)
at org.esa.snap.runtime.Engine.lambda$start$0(Engine.java:121)
at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
at org.esa.snap.runtime.Engine.start(Engine.java:121)
at org.esa.snap.runtime.Engine.start(Engine.java:90)
at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
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(LauncherEngine.java:62)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:101)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:26)

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.

Giulio

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.

Regards,
Giulio

Hi Giulio,

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

Regards,
Cosmin (kraftek).

Thank you for the information Cosmin.

Now it works!!

Regards,
Giulio