GPT suddenly produces Null Pointer Exception

GPT call suddenly produces the Null Pointer Exception when it’s run using the following command:

C:\Program Files\snap\bin>gpt.exe "C:\Radar\AUX_DATA_water_detection\Water_bodies_st1_graph_calibration_snap.xml" 
-x -c 6144M -q 16 
-Pinput="C:\Radar\Sentinel-1\S1A_IW_GRDH_1SDV_20180313T051823_20180313T051848_020992_0240A5_795F.SAFE\manifest.safe" 
-Poutput="C:\Radar\Processed\S1A_IW_GRDH_1SDV_20180313T051823.dim" 
-Pbands="VV,VH"
-Psigma="Sigma0_VV,Sigma0_VH" 
-Psigmaout="Sigma0_VV,Sigma0_VH,layover_shadow_mask"

The same command has been used now for months in the same way, without any such issues.
All required input files are provided and graph calibration xml file has been the same during this whole time.

Error:

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
Executing processing graph
java.lang.NullPointerException
 done.

Error: [NodeId: Remove-GRD-Border-Noise] java.lang.NullPointerException

The error occurred recently but now persists, regardless of whether it’s called from CMD or from IDL code using spawn.

Using option -e there is a more detailed description of the exception, however, I am still unable to determine the exact cause.

Detailed error output:

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
Executing processing graph
java.lang.NullPointerException
 done.
org.esa.snap.core.gpf.graph.GraphException: [NodeId: Remove-GRD-Border-Noise] java.lang.NullPointerException
        at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:79)
        at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
        at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:178)
        at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:178)
        at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:178)
        at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:178)
        at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:178)
        at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:162)
        at org.esa.snap.core.gpf.graph.GraphContext.<init>(GraphContext.java:91)
        at org.esa.snap.core.gpf.graph.GraphContext.<init>(GraphContext.java:64)
        at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:130)
        at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:86)
        at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:534)
        at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:388)
        at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:287)
        at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
        at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
        at org.esa.snap.core.gpf.main.GPT.run(GPT.java:54)
        at org.esa.snap.core.gpf.main.GPT.main(GPT.java:34)
        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 org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55)
        at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
        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)
Caused by: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
        at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:421)
        at org.esa.s1tbx.calibration.gpf.RemoveGRDBorderNoiseOp.initialize(RemoveGRDBorderNoiseOp.java:159)
        at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:486)
        at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:273)
        at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:387)
        at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:77)
        ... 33 more

What could be the cause of this, when nothing has been changed in code or data (that I am aware of)?

Any help would be greatly appreciated! Thanks in advance :slight_smile:

1 Like

Are you still using SNAP 5?
In SNAP6 (with installed updates) there were adaptations to new IPF version of Sentinel-1 data.
So, it might be that you try to process the new version of the sentinel-1 data.

Indeed, I had SNAP 5, but figured it should work since it was regularly updated - yet, I completely missed the SNAP 6 release and Sentinel-1 data change. Only after installing SNAP 6 and all the updates, the GPT procedure went through smoothly again.

Thanks for your help!

I still got this problem after I updated all on SNAP 6. Please help me check.

image

The error message is not very helpful. It just says that there went something wrong (NullPointerException).
Can you have a look into the log file.
You can locate it by invoking Help / Show Log Directory
Maybe there is something more specific to find about the problem
Please ensure that you recreate the problem first, before looking into the file.

Can you open the files in SNAP directly?

May you have a look? I am doing time series in MatLab, so netcdf is very useful than other formats but I couldn’t write in any NETCDF format. I even tried with export or stack. I also tried with other PC and Laptop.
messages.log (74.5 KB)

could this be linked to https://forum.step.esa.int/t/gpt-write-netcdf-vs-netcdf4/13729?u=harmel