GPT Error: java.lang.ExceptionInInitializerError

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
fbecker23
Posts: 17
Joined: Tue Oct 25, 2022 11:16 am America/New_York
Answers: 0

GPT Error: java.lang.ExceptionInInitializerError

by fbecker23 » Wed Jan 11, 2023 9:08 am America/New_York

Hi,
I'm new to SeaDAS gpt mode, and I've been trying to do the "Hello World" example from "https://seadas.gsfc.nasa.gov/help-8.2.0/GptCookbook/gptCookbookWorkflowEx01.html". I currently have SeaDAS 8.2.0 installed, and I'm on Ubuntu 22.1. I've made the WorkflowEx01.xml and WorkflowEx01.par files, and I've used the file "AQUA_MODIS.20100623T181501.L2.OC". Then, command line is:

sh gpt /home/fernando/SeaDAS/bin/WorkflowEx01Graph.xml -p /home/fernando/SeaDAS/bin/WorkflowEx01.par -Pfile=/home/fernando/SeaDAS/bin/AQUA_MODIS.20100623T181501.L2.OC -PofileSuffix='HelloWorld'

I always get an error after executing, "Error: java.lang.ExceptionInInitializerError" and I don't know how to fix it. Do you have any idea?

I have one more questions:
1) Is there any way to avoid the full path to the .xlm, .par and ifile?

Thanks very much,
Fernando

Tags:

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 479
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: GPT Error: java.lang.ExceptionInInitializerError

by OB SeaDAS - xuanyang02 » Wed Jan 11, 2023 4:33 pm America/New_York

I tried the example in https://seadas.gsfc.nasa.gov/help-8.2.0/GptCookbook/gptCookbookWorkflowEx01.html.

1. Since SeaDAS currently has issues with writing to files with NetCDF4-CF format, you should modify the content of WorkflowEx01.par to --
ifileExtension=nc

ofile1Format=NetCDF4-BEAM
ofile1Extension=nc

ofile2Format=BEAM-DIMAP
ofile2Extension=dim

2.

Code: Select all

gpt /home/fernando/SeaDAS/bin/WorkflowEx01Graph.xml -p /home/fernando/SeaDAS/bin/WorkflowEx01.par -Pfile=/home/fernando/SeaDAS/bin/AQUA_MODIS.20100623T181501.L2.OC -PofileSuffix='HelloWorld''
Sorry that you have to provide the full path of .xml and .par files

fbecker23
Posts: 17
Joined: Tue Oct 25, 2022 11:16 am America/New_York
Answers: 0

Re: GPT Error: java.lang.ExceptionInInitializerError

by fbecker23 » Thu Jan 12, 2023 4:58 pm America/New_York

Since versions 8.2 and 8.3 have problems with writing files in netCDF-CF format, I thought I would go back to SeaDAS version 8.1 where Batch Processing worked fine. I was indeed able to write netCDF-CF files, but I had another problem. When I tried to test the .xlm with gpt, I realised that there is no gpt file in the SeaDAS/bin folder.
Is the gpt file in another location? Did the installation go wrong?
I am using Ubuntu 22.1, and when I go into the OCSSW configuration inside SeaDAS I get these errors:
"snap.properties' does not exist"
"gpt.vmoptions' does not exist"
"pconvert.vmoptions' does not exist"

Is there any way to fix this problem?

Thanks!

-----------------------------------------------------------
Main Application Platform:
-----------------------------------------------------------
Application Version: SeaDAS 8.1.0
SNAP Engine Version: 9.0.3* (SeaDAS Platform modified)
SNAP Desktop Version: 9.0.3* (SeaDAS Platform modified)
SNAP Engine Build Date: 202212081832
SNAP Desktop Build Date: 202212081837
Installation Directory: /home/fernando/SeaDAS
Data Directory: /home/fernando/.seadas8
Configuration: /home/fernando/SeaDAS/etc/snap.properties
WARNING!! File '/home/fernando/SeaDAS/etc/snap.properties' does not exist
VM Configuration: /home/fernando/SeaDAS/etc/seadas.conf
VM Configuration: /home/fernando/SeaDAS/etc/snap.conf
VM Configuration (gpt): /home/fernando/SeaDAS/bin/gpt.vmoptions
WARNING!! File '/home/fernando/SeaDAS/bin/gpt.vmoptions' does not exist
VM Configuration (pconvert): /home/fernando/SeaDAS/bin/pconvert.vmoptions
WARNING!! File '/home/fernando/SeaDAS/bin/pconvert.vmoptions' does not exist
Runtime Configuration: /home/fernando/.seadas8/etc/snap.properties
Runtime Configuration (SeaDAS Toolbox): /home/fernando/.seadas8/etc/seadas.properties
JRE: Java(TM) SE Runtime Environment 1.8.0_201-b09
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation
Memory: 3641 MiB
OCSSWROOT (Java Env): null
Python3 Directory: /home/fernando/anaconda3/bin/python3


-----------------------------------------------------------
SeaDAS Toolbox:
-----------------------------------------------------------
SeaDAS Toolbox Version: 1.3.0
SeaDAS Toolbox Build Date: 202212081844
Configuration: /home/fernando/.seadas8/etc/seadas.properties
OCSSW Root Directory: /home/fernando/SeaDAS/ocssw
OCSSW Log Directory: /home/fernando/SeaDAS/bin
OCSSW Location: local
Environment {$OCSSWROOT} (external): null


-----------------------------------------------------------
NASA Science Processing (OCSSW):
-----------------------------------------------------------
Environment {$OCSSWROOT}: /home/fernando/SeaDAS/ocssw
Environment {$OCDATAROOT}: /home/fernando/SeaDAS/ocssw/share
l2gen version: msl12 9.5.1-V2021.2 (Jun 18 2021 11:22:53)
l2bin version: 7.0.1
l3bin version: 5.13
l3mapgen version: l3mapgen 2.3.0-V2021.2 (Jun 18 2021 11:24:42)
Installed Missions: ['czcs', 'goci', 'aqua', 'mos', 'ocm2', 'octs', 'oli', 'seawifs', 'viirsn']


-----------------------------------------------------------
General System and Software:
-----------------------------------------------------------
Operating system: Ubuntu 22.10
Java version: 18.0.2-ea
Python3 version: 3.7.6
Python3 Path: /home/fernando/anaconda3/bin/python3
Env: ASAP_PARMS=/home/fernando/SeaDAS/ocssw/share/common/nav
CC=gcc
_CE_CONDA=
_CE_M=
COLORTERM=truecolor
CONDA_DEFAULT_ENV=base
CONDA_EXE=/home/fernando/anaconda3/bin/conda
CONDA_PREFIX=/home/fernando/anaconda3
CONDA_PROMPT_MODIFIER=(base)
CONDA_PYTHON_EXE=/home/fernando/anaconda3/bin/python
CONDA_SHLVL=1
CXX=g++
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus,guid=c70279610c7780213646e1d463c05b0e
DBUS_STARTER_ADDRESS=unix:path=/run/user/1000/bus,guid=c70279610c7780213646e1d463c05b0e
DBUS_STARTER_BUS_TYPE=session
DEBUGINFOD_URLS=https://debuginfod.ubuntu.com
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
DESKTOP_SESSION=ubuntu
DISPLAY=:1
ELEMENTS=/home/fernando/SeaDAS/ocssw/var/seawifs
EOS_LIB_PREFIX=linux64
FC=gfortran
GCC_TUNE=
GDMSESSION=ubuntu
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_SHELL_SESSION_MODE=ubuntu
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/c0fed631_f414_4d52_9015_daf74ffbd81e
GNOME_TERMINAL_SERVICE=:1.105
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GTK_MODULES=
HDFEOS_LIB=/home/fernando/SeaDAS/ocssw/opt/EOS/lib/linux64
_=/home/fernando/SeaDAS/ocssw/bin/seadas_info
HOME=/home/fernando
HRPT_STATION_IDENTIFICATION_FILE=/home/fernando/SeaDAS/ocssw/share/seawifs/station/station_id.dat
IM_CONFIG_PHASE=1
J2D_PIXMAPS=shared
L2GEN_ANC=/home/fernando/SeaDAS/ocssw/var/anc
LANG=es_AR.UTF-8
LANGUAGE=es_AR:es
LD_LIBRARY_PATH=/home/fernando/SeaDAS/jre1.8.0_201/jre/lib/amd64:/home/fernando/SeaDAS/jre1.8.0_201/jre/lib/i386:/usr/local/netcdf/lib:/usr/local/netcdff/lib
LESSCLOSE=/usr/bin/lesspipe %s %s
LESSOPEN=| /usr/bin/lesspipe %s
LIB3_BIN=/home/fernando/SeaDAS/ocssw/opt/bin
LIB3_CHECK=0
LIB3_DIR=/home/fernando/SeaDAS/ocssw/opt
LIB3_INC=/home/fernando/SeaDAS/ocssw/opt/include
LIB3_LIB=/home/fernando/SeaDAS/ocssw/opt/lib
LOGNAME=fernando
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
NAVCTL=/home/fernando/SeaDAS/ocssw/share/seawifs/nav
NAVQC=/home/fernando/SeaDAS/ocssw/share/seawifs/nav
OCDATAROOT=/home/fernando/SeaDAS/ocssw/share
OCSSW_ARCH=linux_64
OCSSW_BIN=/home/fernando/SeaDAS/ocssw/bin
OCSSW_DEBUG=0
OCSSWROOT=/home/fernando/SeaDAS/ocssw
OCSSW_SVN=localhost
OCTS_REGISTRATION_TABLES=/home/fernando/SeaDAS/ocssw/share/octs/nav
OCVARROOT=/home/fernando/SeaDAS/ocssw/var
ORBCTL=/home/fernando/SeaDAS/ocssw/share/seawifs/nav
PATH=/home/fernando/SeaDAS/ocssw/opt/bin:/home/fernando/SeaDAS/ocssw/bin:/home/fernando/anaconda3/bin:/home/fernando/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
PGSINC=/home/fernando/SeaDAS/ocssw/opt/EOS/include
PGSLIB=/home/fernando/SeaDAS/ocssw/opt/EOS/lib/linux64
PROJ_LIB=/home/fernando/SeaDAS/ocssw/opt/share/proj
PWD=/home/fernando/SeaDAS/bin
QT_ACCESSIBILITY=1
QT_IM_MODULE=ibus
SESSION_MANAGER=local/becker:@/tmp/.ICE-unix/2234,unix/becker:/tmp/.ICE-unix/2234
SHELL=/bin/bash
SHLVL=2
SSH_AGENT_LAUNCHER=openssh
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
SWFTBL=/home/fernando/SeaDAS/ocssw/share/seawifs/qc
SWTBL=/home/fernando/SeaDAS/ocssw/share/seawifs
SYSTEMD_EXEC_PID=2234
TERM=xterm-256color
USER=fernando
USERNAME=fernando
VTE_VERSION=7000
WINDOWPATH=2
XAUTHORITY=/run/user/1000/gdm/Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/etc/xdg
XDG_CURRENT_DESKTOP=ubuntu:GNOME
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_MENU_PREFIX=gnome-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=ubuntu
XDG_SESSION_TYPE=x11
XMODIFIERS=@im=ibus

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 479
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: GPT Error: java.lang.ExceptionInInitializerError

by OB SeaDAS - xuanyang02 » Fri Jan 13, 2023 10:04 am America/New_York

Unfortunately, SeaDAS 8.1.0 does not support gpt command line processing --

https://seadas.gsfc.nasa.gov/release-notes/version/8.1.0/

fbecker23
Posts: 17
Joined: Tue Oct 25, 2022 11:16 am America/New_York
Answers: 0

Re: GPT Error: java.lang.ExceptionInInitializerError

by fbecker23 » Mon Jan 16, 2023 2:00 pm America/New_York

I've reinstalled SeaDAS 8.3.0, and I've tried to execute a simple example, but I keep getting the same error.

Do I have to execute the command line with the terminal in home/fernando/Seadas/bin/ or in another folder?
this is the command line I've been executed. I've tried with [b]bash[/b] or [b]./[/b] instead [b]sh[/b], but I keep getting the same error.

[code]sh gpt /home/fernando/Escritorio/WorkflowEx01Graph.xml -p /home/fernando/Escritorio/WorkflowEx01.par -Pifile=/home/fernando/Escritorio/chl/A2020003181000.L2_LAC_OC.x -PofileSuffix='HelloWorld'[/code]


These are the [b]xml[/b] and [b]par[/b] files that I am using, and the error I get:

[b]WorkflowEx01Graph.xml:[/b]
<graph id="WorkflowEx01Graph">
<version>1.0</version>

<node id="ReadNode">
<operator>Read</operator>
<sources/>
<parameters>
<file>${ifile}.${ifileExtension}</file>
</parameters>
</node>

<node id="WriteFile1Node">
<operator>Write</operator>
<sources>
<source>ReadNode</source>
</sources>
<parameters>
<file>${ifile}_${ofileSuffix}.${ofile1Extension}</file>
<formatName>${ofile1Format}</formatName>
</parameters>
</node>

</graph>


[b]WorkflowEx01.par:[/b]
ifileExtension=nc

ofile1Format=NetCDF4-BEAM
ofile1Extension=nc


[b]Error:[/b]
/usr/lib/jvm/java-18-openjdk-amd64
SEVERE: org.esa.snap.runtime.Engine: Failed to start org.esa.snap.dataio.netcdf.NetCdfActivator
java.lang.RuntimeException: java.lang.NoSuchMethodException: Invalid method : initializePath
at org.esa.snap.core.util.NativeLibraryUtils.registerNativePaths(NativeLibraryUtils.java:59)
at org.esa.snap.dataio.netcdf.NetCdfActivator.activate(NetCdfActivator.java:44)
at org.esa.snap.dataio.netcdf.NetCdfActivator.start(NetCdfActivator.java:53)
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)
Caused by: java.lang.NoSuchMethodException: Invalid method : initializePath
at org.esa.snap.core.util.PrivilegedAccessor.getMethod(PrivilegedAccessor.java:201)
at org.esa.snap.core.util.PrivilegedAccessor.getMethod(PrivilegedAccessor.java:205)
at org.esa.snap.core.util.PrivilegedAccessor.getMethod(PrivilegedAccessor.java:205)
at org.esa.snap.core.util.NativeLibraryUtils.registerNativePaths(NativeLibraryUtils.java:54)
... 9 more

INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SeaDAS experience.
java.lang.ExceptionInInitializerError
at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:820)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:574)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:496)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:465)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:411)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:350)
at org.esa.snap.core.gpf.graph.GraphIO.initXstream(GraphIO.java:114)
at org.esa.snap.core.gpf.graph.GraphIO.read(GraphIO.java:76)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.readGraph(DefaultCommandLineContext.java:75)
at org.esa.snap.core.gpf.main.CommandLineTool.readGraph(CommandLineTool.java:543)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:339)
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:59)
at org.esa.snap.core.gpf.main.GPT.main(GPT.java:37)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
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)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @4a052440
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:180)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:174)
at com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:39)
at com.thoughtworks.xstream.converters.collections.TreeMapConverter.<clinit>(TreeMapConverter.java:50)
... 22 more

Error: java.lang.ExceptionInInitializerError



I don't know if the error is something in the script or something I am missing in SeaDAS.
I am grateful for any assistance.

Fernando

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 479
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: GPT Error: java.lang.ExceptionInInitializerError

by OB SeaDAS - xuanyang02 » Tue Jan 17, 2023 5:04 pm America/New_York

You do not need to run gpt command in /home/fernando/Seadas/bin/. You can just give the absolute path of gpt. Please try

Code: Select all

/home/fernando/Seadas/bin/gpt /home/fernando/Escritorio/WorkflowEx01Graph.xml -p /home/fernando/Escritorio/WorkflowEx01.par -Pifile=/home/fernando/Escritorio/chl/A2020003181000.L2_LAC_OC.x -PofileSuffix='HelloWorld'
I used WorkflowEx01Graph.xml and WorkflowEx01.par with the content you posted. And I was able to successfully execute the command line.

Make sure /home/fernando/Escritorio/chl/A2020003181000.L2_LAC_OC.x.nc exists.

OB SeaDAS - xuanyang02
Subject Matter Expert
Subject Matter Expert
Posts: 479
Joined: Tue Feb 09, 2021 5:42 pm America/New_York
Answers: 1
Been thanked: 1 time

Re: GPT Error: java.lang.ExceptionInInitializerError

by OB SeaDAS - xuanyang02 » Wed Jan 18, 2023 2:27 pm America/New_York

It seems that you are runnign gpt with /usr/lib/jvm/java-18-openjdk-amd64 which is causing the
Error: java.lang.ExceptionInInitializerError

We are looking at how to modify the gpt script so you can run gpt with java 8( 1.8.0) instead of java-18-openjdk-amd64.

fbecker23
Posts: 17
Joined: Tue Oct 25, 2022 11:16 am America/New_York
Answers: 0

Re: GPT Error: java.lang.ExceptionInInitializerError

by fbecker23 » Mon Jan 23, 2023 10:57 am America/New_York

Thank you xuanyang02!!

It was that! I've changed my java to a java 8, and I've made an alias with the absolute path of gpt, and it works fine.

Thanks a lot

Post Reply