title: class not found error - scala
body: <p>i am running a scala program which is below. I am using maven for build and i have set the dependencies correctly and maven install was successful. But when am running the jar file i get java.lang.NoClassDefFoundError.</p>
  
  <p>Program:</p>
  
  <pre><code>package RasterDataIngest.RasterDataIngestIntoHadoop
  
  import geotrellis.spark._
  import geotrellis.spark.ingest._
  import geotrellis.spark.io.hadoop._
  import geotrellis.spark.io.index._
  import geotrellis.spark.tiling._
  import geotrellis.spark.utils.SparkUtils
  import geotrellis.vector._
  import org.apache.hadoop.fs.Path
  import org.apache.spark._
  import com.quantifind.sumac.ArgMain
  import com.quantifind.sumac.validation.Required
  
  class HadoopIngestArgs extends IngestArgs {
    @Required var catalog: String = _
    def catalogPath = new Path(catalog)
  }
  
  object HadoopIngest extends ArgMain[HadoopIngestArgs] with Logging {
    def main(args: HadoopIngestArgs): Unit = {
     System.setProperty("com.sun.media.jai.disableMediaLib", "true")
  
      implicit val sparkContext = SparkUtils.createSparkContext("Ingest")
      val conf = sparkContext.hadoopConfiguration
      conf.set("io.map.index.interval", "1")
  
      val catalog = HadoopRasterCatalog(args.catalogPath)
      val source = sparkContext.hadoopGeoTiffRDD(args.inPath)
      val layoutScheme = ZoomedLayoutScheme()
  
      Ingest[ProjectedExtent, SpatialKey](source, args.destCrs, layoutScheme, args.pyramid){ (rdd, level) =&gt; 
        catalog
          .writer[SpatialKey](RowMajorKeyIndexMethod, args.clobber)
          .write(LayerId(args.layerName, level.zoom), rdd)
      }
    }
  }
  </code></pre>
  
  <p>pom.xml:</p>
  
  <pre><code>&lt;dependency&gt;
    &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
    &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
    &lt;version&gt;${scala.version}&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.spark&lt;/groupId&gt;
    &lt;artifactId&gt;spark-core_2.10&lt;/artifactId&gt;
    &lt;version&gt;1.5.2&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.azavea.geotrellis&lt;/groupId&gt;
    &lt;artifactId&gt;geotrellis-spark_2.10&lt;/artifactId&gt; //this is the one
    &lt;version&gt;0.10.0-M1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.scalaz.stream&lt;/groupId&gt;
    &lt;artifactId&gt;scalaz-stream_2.10&lt;/artifactId&gt;
    &lt;version&gt;0.7.2a&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.apache.hadoop&lt;/groupId&gt;
    &lt;artifactId&gt;hadoop-core&lt;/artifactId&gt;
    &lt;version&gt;0.20.2&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.quantifind&lt;/groupId&gt;
    &lt;artifactId&gt;sumac_2.10&lt;/artifactId&gt;
    &lt;version&gt;0.3.0&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: geotrellis/spark/ingest/IngestArgs
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
          at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
          at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
          at java.lang.Class.getDeclaredMethods0(Native Method)
          at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)
          at java.lang.Class.getMethod0(Class.java:2866)
          at java.lang.Class.getMethod(Class.java:1676)
          at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:670)
          at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
          at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205)
          at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:120)
          at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
  Caused by: java.lang.ClassNotFoundException: geotrellis.spark.ingest.IngestArgs
          at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
          at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  </code></pre>
  
  <p>please let me know where am going wrong..
  Thanks beforehand!</p>