0

I am using Mahout KMeansDriver i.e. Mahout is using Hadoop internally. It works well when I am running with Eclipse.
But when I am creating jar ( runnable jar ) and run, it shows error

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: rsrc:mahout-core-0.7.jar
    at org.apache.hadoop.fs.Path.initialize(Path.java:140)
    at org.apache.hadoop.fs.Path.<init>(Path.java:126)
    at org.apache.hadoop.mapred.JobClient.configureCommandLineOptions(JobClient.java:657)
    at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:761)
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:432)
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:447)
    at org.apache.mahout.clustering.iterator.ClusterIterator.iterateMR(ClusterIterator.java:185)
    at org.apache.mahout.clustering.kmeans.KMeansDriver.buildClusters(KMeansDriver.java:229)
    at org.apache.mahout.clustering.kmeans.KMeansDriver.run(KMeansDriver.java:149)
    at main.java.com.insideview.CompClustering.WorldCompClusteringPrivate.main(WorldCompClusteringPrivate.java:454)
    ... 5 more
Caused by: java.net.URISyntaxException: Relative path in absolute URI: rsrc:mahout-core-0.7.jar
    at java.net.URI.checkPath(URI.java:1804)
    at java.net.URI.<init>(URI.java:752)
    at org.apache.hadoop.fs.Path.initialize(Path.java:137)
    ... 14 more

Can you tell me why it is happening. I am a newbee in Mahout and Hadoop.

neel
  • 8,399
  • 7
  • 36
  • 50

1 Answers1

1

The problem is Eclipse setting up your jarfile's dependencies with the "rsrc:" style so that Hadoop tries to load "rsrc:mahout-core-0.7.jar", but fails because it parses "rsrc" as the "scheme" of the Hadoop filesystem (normally this is implied to be "hdfs"), and then the rest of the string as the "relative path" within that scheme, when in fact, "rsrc" isn't intended to be the Hadoop-filesystem scheme at all.

You should be able to resolve this by enabling the "Package required libraries into generated jar" option when creating your runnable jarfile in Eclipse. Here's an older thread of a similar user experience:

http://lucene.472066.n3.nabble.com/Error-while-running-MapR-program-on-multinode-configuration-td4053610.html

Dennis Huo
  • 10,517
  • 27
  • 43