2012-11-21 94 views
1

我是mahout的新手,我正努力將其安裝在我的Ubuntu 12.10上。正如我看到許多與SLF4J和Eclipse相關的問題,我提到我不使用Eclipse。SLF4J綁定錯誤

maven彙編工作正常。 (MVN安裝-DskipTests =真)

我想我已經正確地設置我的環境變量,這裏是我的/ etc /環境:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-1.6.0-openjdk-amd64/bin:/usr/local/hadoop/bin" 
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-amd64/ 
MAHOUT_HOME=/home/edelans/mahout/ 
HADOOP_HOME=/usr/local/hadoop/ 
HADOOP_CONF_DIR=/usr/local/hadoop/conf 

我開始了一些錯誤,當我開始嘗試和運行一些示例腳本:

[email protected]:/home/edelans/mahout/examples/bin# ./cluster-reuters.sh 
Please select a number to choose the corresponding clustering algorithm 
1. kmeans clustering 
2. fuzzykmeans clustering 
3. dirichlet clustering 
4. minhash clustering 
Enter your choice : 1 
ok. You chose 1 and we'll use kmeans Clustering 
creating work directory at /tmp/mahout-work-root 
MAHOUT_LOCAL is set, so we don't add HADOOP_CONF_DIR to classpath. 
MAHOUT_LOCAL is set, running locally 
SLF4J: Class path contains multiple SLF4J bindings. 
SLF4J: Found binding in [jar:file:/home/edelans/mahout/examples/target/mahout-examples-0.8-SNAPSHOT-job.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/home/edelans/mahout/examples/target/dependency/slf4j-jcl-1.7.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: Found binding in [jar:file:/home/edelans/mahout/examples/target/dependency/slf4j-log4j12-1.4.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. 
SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding. 
SLF4J: Your binding is version 1.5.5 or earlier. 
SLF4J: Upgrade your binding to version 1.6.x. 
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder; 
    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128) 
    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107) 
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295) 
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269) 
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281) 
    at org.apache.mahout.driver.MahoutDriver.<clinit>(MahoutDriver.java:89) 
Could not find the main class: org.apache.mahout.driver.MahoutDriver. Program will exit. 
Running on hadoop, using /usr/local/hadoop/bin/hadoop and HADOOP_CONF_DIR= 
MAHOUT-JOB: /home/edelans/mahout/examples/target/mahout-examples-0.8-SNAPSHOT-job.jar 
12/11/21 14:48:23 INFO vectorizer.SparseVectorsFromSequenceFiles: Maximum n-gram size is: 1 
12/11/21 14:48:23 INFO vectorizer.SparseVectorsFromSequenceFiles: Minimum LLR value: 1.0 
12/11/21 14:48:23 INFO vectorizer.SparseVectorsFromSequenceFiles: Number of reduce tasks: 1 
12/11/21 14:48:24 INFO mapred.JobClient: Cleaning up the staging area hdfs://localhost:54310/app/hadoop/tmp/mapred/staging/root/.staging/job_201211211039_0002 
12/11/21 14:48:24 ERROR security.UserGroupInformation: PriviledgedActionException as:root cause:org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: hdfs://localhost:54310/tmp/mahout-work-root/reuters-out-seqdir 
Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: hdfs://localhost:54310/tmp/mahout-work-root/reuters-out-seqdir 
    at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:235) 
    at org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat.listStatus(SequenceFileInputFormat.java:55) 
    at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:252) 
    at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:962) 
    at org.apache.hadoop.mapred.JobClient.writeSplits(JobClient.java:979) 
    at org.apache.hadoop.mapred.JobClient.access$600(JobClient.java:174) 
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:897) 
    at org.apache.hadoop.mapred.JobClient$2.run(JobClient.java:850) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at javax.security.auth.Subject.doAs(Subject.java:416) 
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) 
    at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:850) 
    at org.apache.hadoop.mapreduce.Job.submit(Job.java:500) 
    at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:530) 
    at org.apache.mahout.vectorizer.DocumentProcessor.tokenizeDocuments(DocumentProcessor.java:93) 
    at org.apache.mahout.vectorizer.SparseVectorsFromSequenceFiles.run(SparseVectorsFromSequenceFiles.java:255) 
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65) 
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79) 
    at org.apache.mahout.vectorizer.SparseVectorsFromSequenceFiles.main(SparseVectorsFromSequenceFiles.java:55) 
    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:616) 
    at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68) 
    at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139) 
    at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:195) 
    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:616) 
    at org.apache.hadoop.util.RunJar.main(RunJar.java:156) 

另一位用戶也有類似的問題here,但我不知道如何編寫代碼,回答他的問題行:

"org.apache.mahout" % "mahout-core" % "0.7" excludeAll(ExclusionRule(organization = "org.slf4j")) 

我沒有授權發表評論他的問題...抱歉打開另一個問題。

感謝您的幫助。

+0

可能重複http://stackoverflow.com/questions/12773694/playframework-multiple-slf4j -bindings) –

回答

1

該問題在堆棧跟蹤中描述。您正在項目中混入slf4j的舊版本。不要這樣做。如果它從第三方來需要被帶到排除。

SLF4J: Found binding in [jar:file:/home/edelans/mahout/examples/target/dependency/slf4j-log4j12-1.4.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] 
[PlayFramework多SLF4J綁定(的
+0

感謝您的快速回復。我如何排除這個版本的slf4j?正如我在我的問題結束時指出的,我沒有得到[PlayFramework Multiple SLF4J bindings]的答案(http://stackoverflow.com/questions/12773694/playframework-multiple-slf4j-bindings) – edelans

+0

我沒有知道,你是如何包含它的? –

+0

我不知道,我沒有故意這樣做=)。我在哪裏可以看到它來自哪裏?我沒有修改pom.xml。 我應該從'/ home/edelans/mahout/examples/target/dependency /'中刪除slf4j-log4j12-1.4.3.jar嗎?或者修改pom.xml? – edelans