제발 도와주세요. 다음은 작업을 실행하는 코드입니다.hadoop -libjars 및 ClassNotFoundException
hadoop jar mrjob.jar ru.package.Main -files hdfs://0.0.0.0:8020/MyCatalog/jars/metadata.csv -libjars hdfs://0.0.0.0:8020/MyCatalog/jars/opencsv.jar,hdfs://0.0.0.0:8020/MyCatalog/jars/gson.jar,hdfs://0.0.0.0:8020/MyCatalog/jars/my-utils.jar /MyCatalog/http_requests.seq-r-00000 /MyCatalog/output/result_file
나는 이것들을 얻는다는 경고 : 다음
12/10/26 18:35:50 WARN util.GenericOptionsParser: The libjars file hdfs://0.0.0.0:8020/MyCatalog/jars/opencsv.jar is not on the local filesystem. Ignoring.
12/10/26 18:35:50 WARN util.GenericOptionsParser: The libjars file hdfs://0.0.0.0:8020/MyCatalog/jars/gson.jar is not on the local filesystem. Ignoring.
12/10/26 18:35:50 WARN util.GenericOptionsParser: The libjars file hdfs://0.0.0.0:8020/MyCatalog/jars/my-utils.jar is not on the local filesystem. Ignoring.
: 스레드 예외 "기본"java.lang.NoClassDefFoundError가 : 나는 단지에서 클래스를 인스턴스화하려고 Main 클래스 라인에 내-utils.jar 이름
- 이 모든 항아리 (I 파일 브라우저를 통해 참조) hfds에 ,536,913,632 10
- 내-utils.jar는 NoClassDefFoundError를 내가 잘못합니까 무엇
이유입니다 클래스를 포함합니까?
UPD : 내가 의 GenericOptionsParser 소스 코드를 검사하고 있습니다 : 그래서
/**
* If libjars are set in the conf, parse the libjars.
* @param conf
* @return libjar urls
* @throws IOException
*/
public static URL[] getLibJars(Configuration conf) throws IOException {
String jars = conf.get("tmpjars");
if(jars==null) {
return null;
}
String[] files = jars.split(",");
List<URL> cp = new ArrayList<URL>();
for (String file : files) {
Path tmp = new Path(file);
if (tmp.getFileSystem(conf).equals(FileSystem.getLocal(conf))) {
cp.add(FileSystem.getLocal(conf).pathToFile(tmp).toURI().toURL());
} else {
LOG.warn("The libjars file " + tmp + " is not on the local " +
"filesystem. Ignoring.");
}
}
return cp.toArray(new URL[0]);
}
: 쉼표 2. 사이 1. 공백은 여전히 그것을 얻을하지 않습니다 ... 나는했습니다 로컬 파일 시스템, hdfs 파일 시스템, 결과는 동일합니다. 클래스가 추가되지 않은 것 같습니다 ...
자세한 대답은 여기에 게시 : http://stackoverflow.com/questions/6890087/problem-with-libjars-in-hadoop –