我正在尝试NaiveBayesClassifer使用hadoop 运行一个简单的程序,出现此错误Exception in thread "main" java.io.IOException: No FileSystem for scheme: file at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1375) at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66) at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1390) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:196) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:95) at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:180) at org.apache.hadoop.fs.Path.getFileSystem(Path.java:175) at org.apache.mahout.classifier.naivebayes.NaiveBayesModel.materialize(NaiveBayesModel.java:100)代码: Configuration configuration = new Configuration(); NaiveBayesModel model = NaiveBayesModel.materialize(new Path(modelPath), configuration);// error in this line..modelPath指向NaiveBayes.bin文件,并且配置对象正在打印-Configuration: core-default.xml, core-site.xml我认为是因为罐子,有什么想法吗?
3 回答

白衣染霜花
TA贡献1796条经验 获得超10个赞
对于使用shade插件的用户,按照david_p的建议,您可以通过将ServicesResourceTransformer添加到插件配置中来合并阴影jar中的服务:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
这会将所有org.apache.hadoop.fs.FileSystem服务合并到一个文件中
添加回答
举报
0/150
提交
取消