Page 1 of 1

gpt reprojection error

Posted: Tue Feb 04, 2020 9:35 am America/New_York
by junzhao
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

gpt reprojection error

Posted: Wed Feb 05, 2020 7:57 am America/New_York
by gnwiii
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)

gpt reprojection error

Posted: Thu Feb 06, 2020 5:06 am America/New_York
by junzhao
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

gpt reprojection error

Posted: Thu Feb 06, 2020 8:01 am America/New_York
by OB SeaDAS - dshea
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

gpt reprojection error

Posted: Fri Feb 07, 2020 1:53 am America/New_York
by junzhao
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

gpt reprojection error

Posted: Fri Feb 07, 2020 10:35 am America/New_York
by gnwiii
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".

gpt reprojection error

Posted: Sat Feb 08, 2020 7:45 am America/New_York
by junzhao
Thank you very much, George. It works now.

Jun

gpt reprojection error

Posted: Tue Dec 08, 2020 12:36 am America/New_York
by dima_lm
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.

gpt reprojection error

Posted: Tue Dec 08, 2020 7:03 am America/New_York
by gnwiii
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

gpt reprojection error

Posted: Wed Dec 09, 2020 12:31 am America/New_York
by dima_lm
Thanks a lot! I'll try it.