'gpt mosaic' error

I have a problem with the mosaic operator.
In fact, I can apply the mosaic processing in SNP Window application to compute two resampled subset images from S2A data, but I cannot go processing in command line with “gpt Mosaic [options] …”.
My command lines are showed below:

gpt ./s2mosaicid2.xml -PvarBandName=“B1” -PvarBandExpression=“B1” “subset_1_of_20151020T025732_N0204_R132_resampled.dim” “subset_0_of_target_resampled.dim”

My xml files are attached here:
s2mosaicid2.xml (916 Bytes)

but I got the error:
Executing processing graph
INFO: org.hsqldb.persist.Logger: dataFileCache open start
done.
java.lang.IllegalArgumentException: Width (0) and height (0) must be > 0
at java.awt.image.SampleModel.(SampleModel.java:126)
at java.awt.image.ComponentSampleModel.(ComponentSampleModel.java:146)
at javax.media.jai.ComponentSampleModelJAI.(Unknown Source)
at org.esa.snap.core.util.jai.SingleBandedSampleModel.(SingleBandedSampleModel.java:62)
at org.esa.snap.core.util.ImageUtils.createSingleBandedSampleModel(ImageUtils.java:484)
at org.esa.snap.core.image.ImageManager.createSingleBandedImageLayout(ImageManager.java:190)
at org.esa.snap.core.image.ImageManager.createSingleBandedImageLayout(ImageManager.java:152)
at org.esa.snap.core.gpf.common.reproject.ReprojectionOp$3.createImage(ReprojectionOp.java:513)
at com.bc.ceres.glevel.support.AbstractMultiLevelSource.getImage(AbstractMultiLevelSource.java:65)
at com.bc.ceres.glevel.support.DefaultMultiLevelImage.(DefaultMultiLevelImage.java:45)
at org.esa.snap.core.gpf.common.reproject.ReprojectionOp.createProjectedImage(ReprojectionOp.java:490)
at org.esa.snap.core.gpf.common.reproject.ReprojectionOp.reprojectSourceRaster(ReprojectionOp.java:390)
at org.esa.snap.core.gpf.common.reproject.ReprojectionOp.reprojectRasterDataNodes(ReprojectionOp.java:344)
at org.esa.snap.core.gpf.common.reproject.ReprojectionOp.initialize(ReprojectionOp.java:295)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:528)
at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:298)
at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:385)
at org.esa.snap.core.gpf.GPF.createProductNS(GPF.java:333)
at org.esa.snap.core.gpf.GPF.createProduct(GPF.java:308)
at org.esa.snap.core.gpf.GPF.createProduct(GPF.java:287)
at org.esa.snap.core.gpf.common.MosaicOp.createReprojectedProducts(MosaicOp.java:377)
at org.esa.snap.core.gpf.common.MosaicOp.initialize(MosaicOp.java:145)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:528)
at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:298)
at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:385)
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:77)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:199)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:182)
at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:166)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:85)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:58)
at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:118)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:86)
at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:547)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:391)
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)

Error: Width (0) and height (0) must be > 0

What could be the reasons for the errors?
Thank you

The reason is that you specify the pixel size with the value 10.
But pixel size must be given in map unit and for WGS84 it is degree. So you specify 10°.
And this probably results in 0 pixels for the target.
If you want a 10 meter resolution output, try using 0.0001°. This is ~11 meter.

Thank you very much. Since the Sentinel-2A image has a spatial resolution of 10m, I want to mosaic the two images with 10m resolution. I want to set the projection as “UTM/WGS84(automatic)” as that shown in SNAP window application (mosaicing ) in crs parameters of XML file. How could we get all these projection parameters that can set in crs?

If you want to use UTM you need to specify a different CRS.
<crs>AUTO:42001</crs> should work. That’s also what is shown in the Mosaic GUI.
As alternative you can open the Reprojection select a product and the CRS and the click on show WKT.
This can also be used for the crs parameter.

If you do so, you can keep the 10 meter.

Keep in mind that the distortion can be quite significant if parts of the mosaicked scene are outside of the UTM zone. So your mosaicked area should not get to big.

OK,It can work well. Thank you very much.