I’ve been using a java maven project I developed in NetBeans which calls on the operators I need from SNAP and S1TBX to do the processing I need. I usually run it from the IDE with no problems, but I’m trying to use it on another computer (specifically a HPC system).
I’ve succeeded in building a jar file containing all dependencies by adding the maven-assembly-plugin to the pom file.
All operations which run on librairies like java.io or java.utils succeed, as well as reading a .dim product, but we run into a problem with the first call to CreateProduct :
$ java -jar java-snap-jar-with-dependencies.jar "input.txt" Input
... (info on the products that have been read)
Exception in thread "main" org.esa.snap.core.gpf.OperatorException : Unkown operator 'Subset'. Note that operator aliases are case-sensitive.
at org.esa.snap.core.gpf.GPF.CreateProduct
Your help would be greatly appreciated, I’m participating in a hackathon and hope to get it working before tomorrow !
Good to hear that you found a solution, though this does not look like the ideal way. I’ve seen that you do not have a dependency to snap-gpf set. Maybe including it would fix the problem, too.
I tried to use your solution. SNAP GPF is already included as a dependency in the project; it is listed under the Dependency folder in Netbeans. However, it doesn’t appear in the pom.xml (why ?). So I added it like this :
Thank you for your help @TonioF, I’ve got it working now. I used the maven-dependency-plugin with the maven-jar-plugin; I chose to have a light executable jar with all the dependencies in a lib/ directory. This post shows a relevent excerpt from my pom.xml file. I only kept the two lines referencing my new operators in my OperatorSpi file. The complete files can be found in the project on gitlab.