[英]Distributed Cache Jar in classpath but getting ClassNotFoundException
使用HBaseTestingUtility我将启动一个小型集群。
testUtil = new HBaseTestingUtility(configuration);
testUtil.startMiniCluster();
并提供我的jar放在DistributedCache的classpath中
final String aJarResourcePath = Thread.currentThread().getContextClassLoader()
.getResource("abc/a-1.0.jar").getPath();
final FileSystem fs = FileSystem.get(configuration);
final Path pathToArtifacts = new Path("/Runtime/a-artifacts");
fs.mkdirs(pathToArtifacts);
fs.copyFromLocalFile(new Path(aJarResourcePath), pathToArtifacts));
DistributedCache.addFileToClassPath(disqualified, configuration);
在我的MapFn上,我正在使用jar-1.0.jar。 我可以在MapFn中看到罐子
final Path[] fus = DistributedCache.getFileClassPaths(config);
因此,我认为该jar位于classpath中并指向HDFS位置,但是在尝试创建对象时出现classnotfoundexception。 我不确定发生了什么请帮忙。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.