0

I am working on a project which uses spatial hadoop for join operation. After I compiled and tried to run a spatial hadoop jar on top of hadoop I got an error message.

java.lang.NoClassDefFoundError: com/vividsolutions/jts/geom/GeometryFactory

The command which i used to run spatial hadoop is:

hadoop jar spatialhadoop-2.4.4.jar generate test mbr:0,0,1000000,1000000 size:1.gb shape:rect

I tried to include the dependency in pom.xml i.e,

<dependency>
    <groupId>com.vividsolutions</groupId>
    <artifactId>jts</artifactId>
    <version>1.13</version>
</dependency>

But after compiling the error remains the same. Please let me know if there are any other solutions for this.

Complete ERROR message:

 hadoop jar spatialhadoop-2.4.3-SNAPSHOT.jar
java.lang.NoClassDefFoundError: com/vividsolutions/jts/geom/GeometryFactory
        at edu.umn.cs.spatialHadoop.operations.Union.<clinit>(Union.java:72)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at edu.umn.cs.spatialHadoop.operations.Main.main(Main.java:56)
        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.apache.hadoop.util.RunJar.run(RunJar.java:323)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:236)
Caused by: java.lang.ClassNotFoundException: com.vividsolutions.jts.geom.GeometryFactory
        at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        ... 10 more
Pexers
  • 953
  • 1
  • 7
  • 20
skm
  • 19
  • 3
  • SOLVED!! Create a FAT/UBER jar used Maven to create a fat jar and used it and it solved the problem. try this - https://stackoverflow.com/questions/16222748/building-a-fat-jar-using-maven – skm Oct 18 '22 at 15:03

0 Answers0