Error: java.lang.NullPointerException in GPT , no error in SNAP


#1

Hi Friends and @marpet ,

I am getting the below error, though the L1C was converted into an L2A in 241 secs.

I have installed sen2cor via SNAP 6 , Using Py 3.4.3 with snappy:

Only in gpt interface (no error in SNAP GUI) :

gpt Sen2Cor ‘C:\Users\rs2\PycharmProjects\FarmScoreDownloadImages\test1\S2B_MSIL1C_20180401T045649_N0206_R119_T44PLC_20180401T075939.SAFE’
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.s2.ortho.S2OrthoProductReaderPlugIn: Building product reader - EPSG:32644
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [metadata_level] does not exist
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [granuleidentifier] does not exist
WARNING: org.esa.s2tbx.dataio.metadata.GenericXmlMetadata: Metadata: the path to element [bandid] does not exist
INFO: org.hsqldb.persist.Logger: dataFileCache open start
Warning: org.apache.xerces.parsers.SAXParser: Property ‘http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit’ is not recognized.
Compiler warnings:
WARNING: ‘org.apache.xerces.jaxp.SAXParserImpl: Property ‘http://javax.xml.XMLConstants/property/accessExternalDTD’ is not recognized.’
Compiler warnings:
WARNING: ‘org.apache.xerces.jaxp.SAXParserImpl: Property ‘http://javax.xml.XMLConstants/property/accessExternalDTD’ is not recognized.’
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterOp: Executing tool ‘Sen2Cor’ with command line: ‘C:\Users\rs2.snap\auxdata\Sen2Cor-02.05.05-win64\L2A_Process.bat --resolution 60 C:\Users\rs2\PycharmProjects\FarmScoreDownloadImages\test1\S2B_MSIL1C_20180401T045649_N0206_R119_T44PLC_20180401T075939.SAFE --GIP_L2A C:\Users\rs2.snap\auxdata\tool-adapters\Sen2Cor\L2A-GIPP25-custom.xml’
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Sentinel-2 Level 2A Processor (Sen2Cor). Version: 2.5.5, created: 2018.03.19, supporting Level-1C product version <= 14.5 started …
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Product version: 14.5. Operation mode: PDGS. Processing baseline: 02.06.
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Selected resolution: 60 m.
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 1.78 : PID-2228, L2A_ProcessTile: processing with resolution 60 m, elapsed time[s]: 3.565, total: 0:00:11.843000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 1.80 : PID-2228, L2A_ProcessTile: start of pre processing, elapsed time[s]: 0.044, total: 0:00:11.887000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 1.85 : PID-2228, L2A_Tables: start import, elapsed time[s]: 0.100, total: 0:00:11.987000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 2.27 : PID-2228, L2A_Tables: band B01 imported, elapsed time[s]: 0.846, total: 0:00:12.833000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 10.88 : PID-2228, L2A_Tables: band B02 imported, elapsed time[s]: 17.277, total: 0:00:30.110000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 19.39 : PID-2228, L2A_Tables: band B03 imported, elapsed time[s]: 17.062, total: 0:00:47.172000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 29.80 : PID-2228, L2A_Tables: band B04 imported, elapsed time[s]: 20.871, total: 0:01:08.043000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 33.01 : PID-2228, L2A_Tables: band B05 imported, elapsed time[s]: 6.454, total: 0:01:14.497000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 36.19 : PID-2228, L2A_Tables: band B06 imported, elapsed time[s]: 6.375, total: 0:01:20.872000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 39.53 : PID-2228, L2A_Tables: band B07 imported, elapsed time[s]: 6.707, total: 0:01:27.579000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 42.35 : PID-2228, L2A_Tables: band B8A imported, elapsed time[s]: 5.644, total: 0:01:33.223000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 42.74 : PID-2228, L2A_Tables: band B09 imported, elapsed time[s]: 0.793, total: 0:01:34.016000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 43.00 : PID-2228, L2A_Tables: band B10 imported, elapsed time[s]: 0.511, total: 0:01:34.527000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 46.45 : PID-2228, L2A_Tables: band B11 imported, elapsed time[s]: 6.917, total: 0:01:41.444000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 49.71 : PID-2228, L2A_Tables: band B12 imported, elapsed time[s]: 6.538, total: 0:01:47.982000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 49.73 : PID-2228, L2A_ProcessTile: start of Scene Classification, elapsed time[s]: 0.039, total: 0:01:48.021000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 49.91 : PID-2228, Pre process , elapsed time[s]: 0.364, total: 0:01:48.385000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 50.64 : PID-2228, L2A_SC init , elapsed time[s]: 1.474, total: 0:01:49.859000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 50.87 : PID-2228, L2A_CSND_1_1 , elapsed time[s]: 0.449, total: 0:01:50.308000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 51.08 : PID-2228, L2A_CSND_1_2 , elapsed time[s]: 0.434, total: 0:01:50.742000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 51.52 : PID-2228, L2A_CSND_3 , elapsed time[s]: 0.872, total: 0:01:51.614000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 51.80 : PID-2228, L2A_CSND_5_1 , elapsed time[s]: 0.566, total: 0:01:52.180000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 52.24 : PID-2228, L2A_CSND_5_2 , elapsed time[s]: 0.883, total: 0:01:53.063000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 52.60 : PID-2228, L2A_CSND_6 , elapsed time[s]: 0.715, total: 0:01:53.778000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 52.82 : PID-2228, L2A_CSND_6_2 , elapsed time[s]: 0.450, total: 0:01:54.228000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 53.04 : PID-2228, L2A_CSND_7 , elapsed time[s]: 0.431, total: 0:01:54.659000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 57.49 : PID-2228, L2A_SHD , elapsed time[s]: 8.937, total: 0:02:03.596000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 57.82 : PID-2228, DV recovery , elapsed time[s]: 0.666, total: 0:02:04.262000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 58.17 : PID-2228, WP recovery , elapsed time[s]: 0.688, total: 0:02:04.950000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 58.17 : PID-2228, WP recovery with CCI Water Bodies at 150m , elapsed time[s]: 0.015, total: 0:02:04.965000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 58.52 : PID-2228, Snow recovery , elapsed time[s]: 0.691, total: 0:02:05.656000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 58.67 : PID-2228, Soil recovery , elapsed time[s]: 0.297, total: 0:02:05.953000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 58.68 : PID-2228, Land recovery with B10, B09 and B8A , elapsed time[s]: 0.019, total: 0:02:05.972000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 58.68 : PID-2228, Cirrus recovery with B10 , elapsed time[s]: 0.013, total: 0:02:05.985000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 58.69 : PID-2228, Urban and Bare pixel recovery with CCI Land Cover Map at 300 m , elapsed time[s]: 0.009, total: 0:02:05.994000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 59.19 : PID-2228, Post process , elapsed time[s]: 1.003, total: 0:02:06.997000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 59.19 : PID-2228, L2A_ProcessTile: start of Atmospheric Correction, elapsed time[s]: 0.015, total: 0:02:07.012000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 59.50 : PID-2228, L2A_AtmCorr: end of calculation terrain maps, elapsed time[s]: 0.621, total: 0:02:07.633000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 59.51 : PID-2228, L2A_AtmCorr: start of AOT retrieval at 550nm, elapsed time[s]: 0.018, total: 0:02:07.651000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 60.71 : PID-2228, L2A_AtmCorr: end of internal classification, elapsed time[s]: 2.399, total: 0:02:10.050000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 61.33 : PID-2228, L2A_AtmCorr: end of interpolation LUTs, elapsed time[s]: 1.253, total: 0:02:11.303000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 61.34 : PID-2228, L2A_AtmCorr: end retrieving reference pixels for dark areas, elapsed time[s]: 0.012, total: 0:02:11.315000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 63.96 : PID-2228, L2A_AtmCorr: end of check for dense bright vegetation pixels, elapsed time[s]: 5.257, total: 0:02:16.572000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 65.10 : PID-2228, L2A_AtmCorr: end of receiving atmospheric functions for all altitudes and visibilities, elapsed time[s]: 2.285, total: 0:02:18.857000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 65.12 : PID-2228, L2A_AtmCorr: end of AOT retrieval at 550nm, elapsed time[s]: 0.033, total: 0:02:18.890000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 65.13 : PID-2228, L2A_AtmCorr: start of water vapour retrieval, elapsed time[s]: 0.033, total: 0:02:18.923000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 65.83 : PID-2228, L2A_AtmCorr: end of water vapour retrieval preparation, elapsed time[s]: 1.407, total: 0:02:20.330000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 82.70 : PID-2228, L2A_AtmCorr: end of water vapour retrieval, elapsed time[s]: 33.835, total: 0:02:54.165000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 82.71 : PID-2228, L2A_AtmCorr: preparation of surface reflectance retrieval, elapsed time[s]: 0.011, total: 0:02:54.176000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 87.18 : PID-2228, L2A_AtmCorr: end of surface reflectance retrieval preparation, elapsed time[s]: 8.980, total: 0:03:03.156000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 97.38 : PID-2228, L2A_AtmCorr: end of surface reflectance retrieval, elapsed time[s]: 20.451, total: 0:03:23.607000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.64 : PID-2228, L2A_AtmCorr: end of rho retrieval step 2, elapsed time[s]: 11.604, total: 0:03:35.211000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.30 : PID-2228, L2A_ProcessTile: start of post processing, elapsed time[s]: 0.044, total: 0:03:35.255000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 98.93 : PID-2228, L2A_Tables: start export, elapsed time[s]: 0.012, total: 0:03:35.267000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.08 : PID-2228, L2A_Tables: band B01 exported, elapsed time[s]: 1.036, total: 0:03:36.303000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.26 : PID-2228, L2A_Tables: band B02 exported, elapsed time[s]: 1.100, total: 0:03:37.403000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.39 : PID-2228, L2A_Tables: band B03 exported, elapsed time[s]: 1.003, total: 0:03:38.406000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.52 : PID-2228, L2A_Tables: band B04 exported, elapsed time[s]: 1.004, total: 0:03:39.410000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.63 : PID-2228, L2A_Tables: band B05 exported, elapsed time[s]: 1.061, total: 0:03:40.471000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.63 : PID-2228, L2A_Tables: band B06 exported, elapsed time[s]: 1.037, total: 0:03:41.508000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.63 : PID-2228, L2A_Tables: band B07 exported, elapsed time[s]: 1.051, total: 0:03:42.559000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.63 : PID-2228, L2A_Tables: band B8A exported, elapsed time[s]: 1.016, total: 0:03:43.575000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.63 : PID-2228, L2A_Tables: band B09 exported, elapsed time[s]: 1.064, total: 0:03:44.639000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.63 : PID-2228, L2A_Tables: band B11 exported, elapsed time[s]: 1.043, total: 0:03:45.682000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.63 : PID-2228, L2A_Tables: band B12 exported, elapsed time[s]: 1.007, total: 0:03:46.689000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.44 : PID-2228, L2A_Tables: band SCL exported, elapsed time[s]: 0.359, total: 0:03:47.048000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.19 : PID-2228, L2A_Tables: band SNW exported, elapsed time[s]: 0.231, total: 0:03:47.279000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.13 : PID-2228, L2A_Tables: band CLD exported, elapsed time[s]: 0.630, total: 0:03:47.909000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 98.92 : PID-2228, L2A_Tables: band AOT exported, elapsed time[s]: 0.316, total: 0:03:48.225000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 98.81 : PID-2228, L2A_Tables: band WVP exported, elapsed time[s]: 0.522, total: 0:03:48.747000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 98.73 : PID-2228, L2A_Tables: band PVI exported, elapsed time[s]: 0.594, total: 0:03:49.341000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.42 : PID-2228, L2A_Tables: band TCI exported, elapsed time[s]: 2.105, total: 0:03:51.446000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 99.06 : PID-2228, L2A_Tables: stop export, elapsed time[s]: 0.026, total: 0:03:51.472000
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer: Progress[%]: 100.00 : Application terminated successfully.
INFO: org.esa.snap.core.gpf.operators.tooladapter.DefaultOutputConsumer:

Finished tool execution in 241 seconds

java.lang.NullPointerException
at org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterOp.postExecute(ToolAdapterOp.java:380)
at org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterOp.initialize(ToolAdapterOp.java:224)
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.main.CommandLineTool.runOperator(CommandLineTool.java:306)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:284)
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$14(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:16)

Error: java.lang.NullPointerException


#2

Hi , Just to add on :slight_smile:
There is no difference in the file count and folder size (L2A foldeer) created by gpt command line and SNAP gui with sen2cor:


#3

Hi,

I am not able to reproduce your problem. Have you updated your SNAP installation? Are you able to open the output product in SNAP?

On the other hand, in my opinion, to run sen2cor via GPT is an error. First of all, you can execute directly sen2cor by using the L2A_Process command in your sen2cor installation. When you execute it from gpt, it is similar to run the graph Read->Sen2Cor->Write, the problem in this case is that Sen2Cor already writes the output, so in fact, you are writting the output twice (Sen2Cor writes it in SAFE format at the same folder where it is the input L1C product and then the “Write” operator writes it in BEAM-DIMAP format, by default in your user folder and with the name “target”).