gpt reprojection error

Please enter here to ask a question about any NASA Science related topics!
Post Reply
junzhao
Posts: 26
Joined: Fri Oct 07, 2011 11:21 am America/New_York

gpt reprojection error

by junzhao » Tue Feb 04, 2020 9:35 am America/New_York

Hi,

I tried to do reprojection using the gpt tool. The executed command was 'gpt.sh -e ./reproj.xml -Ssource=./tmp/V2019285033600.L2_SNPP.nc'. But it failed and the error message is attached below. I ran the command in Ubuntu.

com.thoughtworks.xstream.converters.ConversionException: Cannot construct org.esa.beam.framework.gpf.graph.Graph as it does not have a no-args constructor : Cannot construct org.esa.beam.framework.gpf.graph.Graph as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.esa.beam.framework.gpf.graph.Graph as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.esa.beam.framework.gpf.graph.Graph as it does not have a no-args constructor
class               : org.esa.beam.framework.gpf.graph.Graph
required-type       : org.esa.beam.framework.gpf.graph.Graph
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /graph
line number         : 1
version             : null
-------------------------------
  at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
  at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
  at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
  at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
  at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
  at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
  at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1052)
  at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1036)
  at com.thoughtworks.xstream.XStream.fromXML(XStream.java:912)
  at org.esa.beam.framework.gpf.graph.GraphIO.read(GraphIO.java:83)
  at org.esa.beam.framework.gpf.main.DefaultCommandLineContext.readGraph(DefaultCommandLineContext.java:71)
  at org.esa.beam.framework.gpf.main.CommandLineTool.readGraph(CommandLineTool.java:504)
  at org.esa.beam.framework.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:305)
  at org.esa.beam.framework.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:249)
  at org.esa.beam.framework.gpf.main.CommandLineTool.run(CommandLineTool.java:150)
  at org.esa.beam.framework.gpf.main.CommandLineTool.run(CommandLineTool.java:122)
  at org.esa.beam.framework.gpf.main.GPT.run(GPT.java:54)
  at org.esa.beam.framework.gpf.main.GPT.main(GPT.java:34)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at com.bc.ceres.launcher.Launcher.launch(Launcher.java:154)
  at com.bc.ceres.launcher.Launcher.main(Launcher.java:56)
Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct org.esa.beam.framework.gpf.graph.Graph as it does not have a no-args constructor
  at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.newInstance(PureJavaReflectionProvider.java:71)
  at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:428)
  at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:233)
  at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
  ... 23 more

Error: Cannot construct org.esa.beam.framework.gpf.graph.Graph as it does not have a no-args constructor : Cannot construct org.esa.beam.framework.gpf.graph.Graph as it does not have a no-args constructor
---- Debugging information ----
message             : Cannot construct org.esa.beam.framework.gpf.graph.Graph as it does not have a no-args constructor
cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
cause-message       : Cannot construct org.esa.beam.framework.gpf.graph.Graph as it does not have a no-args constructor
class               : org.esa.beam.framework.gpf.graph.Graph
required-type       : org.esa.beam.framework.gpf.graph.Graph
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /graph
line number         : 1
version             : null
-------------------------------

How can I solve it? Thanks.

Jun

Tags:

gnwiii
Posts: 573
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 1

gpt reprojection error

by gnwiii » Wed Feb 05, 2020 7:57 am America/New_York

This looks like the error reported on the BEAM Forum where  gpt.sh was using an older Java version. 

I have found it helpful to edit gpt.sh to add  -showversion to the Java command line in gpt.sh as follows:

"$app_java_home/bin/java" -showversion \

On my linux system this gives:

$ $SEADAS_HOME/bin/gpt_debug.sh [...]"
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

junzhao
Posts: 26
Joined: Fri Oct 07, 2011 11:21 am America/New_York

gpt reprojection error

by junzhao » Thu Feb 06, 2020 5:06 am America/New_York

Hi George,

Thanks for your reply. Following your suggestion, here is what I got:

openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~16.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)

Still waiting for solutions.

Jun

OB SeaDAS - dshea
Subject Matter Expert
Subject Matter Expert
Posts: 203
Joined: Thu Mar 05, 2009 10:25 am America/New_York

gpt reprojection error

by OB SeaDAS - dshea » Thu Feb 06, 2020 8:01 am America/New_York

Open JDK has never worked for us with SeaDAS.  I would suggest installing Oracle Java 1.8.  SeaDAS does not work with versions higher than 8.  You can get it here:

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

don

junzhao
Posts: 26
Joined: Fri Oct 07, 2011 11:21 am America/New_York

gpt reprojection error

by junzhao » Fri Feb 07, 2020 1:53 am America/New_York

Thank you, Don.

I reset the path of java. gtp.sh can be run now. But I got another problem. The command line used was:
gpt.sh l2_proj_sub.xml -Ssource=$inpath$l2_fname -Pofile1=$p_fname1 -Pofile2=$p_fname2 -Poformat=HDF5

It failed with the following error message:

Error: No data product writer for the 'HDF5' format available

I searched in the forum and found several other related threads. But I didn't find any solution to it.

Please help this out.

Thanks again.

Jun

gnwiii
Posts: 573
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 1

gpt reprojection error

by gnwiii » Fri Feb 07, 2020 10:35 am America/New_York

HDF5 is a very flexible format.  NetCDF4-CF actually uses a subset of the HDF5 format combined with a rigorous metadata standard (the "-CF").   Try using "NetCDF".

junzhao
Posts: 26
Joined: Fri Oct 07, 2011 11:21 am America/New_York

gpt reprojection error

by junzhao » Sat Feb 08, 2020 7:45 am America/New_York

Thank you very much, George. It works now.

Jun

dima_lm
Posts: 2
Joined: Fri Nov 20, 2015 7:48 am America/New_York

gpt reprojection error

by dima_lm » Tue Dec 08, 2020 12:36 am America/New_York

Where did you reset the pass of java to solve the issue with gpt.sh? I have the same problem, but earlier my script worked.

How can I fix it?

Dima.

gnwiii
Posts: 573
Joined: Fri Jan 29, 2021 5:51 pm America/New_York
Answers: 1

gpt reprojection error

by gnwiii » Tue Dec 08, 2020 7:03 am America/New_York

You can edit gpt.sh.   For example, to use the Java runtime from ESA SNAP, edit gpt.sh to replace the line:
"$app_java_home/bin/java" -showversion
to read:
"$HOME/snap/jre/bin/java" -showversion

dima_lm
Posts: 2
Joined: Fri Nov 20, 2015 7:48 am America/New_York

gpt reprojection error

by dima_lm » Wed Dec 09, 2020 12:31 am America/New_York

Thanks a lot! I'll try it.

Post Reply