hbase mapreduce与google.inject不匹配

jjhzyzn0  于 2021-06-09  发布在  Hbase
关注(0)|答案(1)|浏览(455)

我正在尝试使用我们的内部框架(使用guice4.0)对hbase表进行map reduce
看起来像Yarn可能使用版本3.0,我得到一个类型不匹配。 2016-03-25 08:19:45,784 ERROR [main] org.apache.hadoop.mapred.YarnChild: Error running child : java.lang.NoSuchMethodError: com.google.inject.multibindings.MultibindingsScanner$1.binder()Lcom/shaded/google/inject/Binder; at com.google.inject.multibindings.MultibindingsScanner$1.configure(MultibindingsScanner.java:53) at com.google.inject.AbstractModule.configure(AbstractModule.java:59) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) at com.google.inject.AbstractModule.install(AbstractModule.java:118) at my.packagename.client.KafkaModule.configure(KafkaModule.java:36) at com.google.inject.AbstractModule.configure(AbstractModule.java:59) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) at com.google.inject.spi.Elements.getElements(Elements.java:101) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103) at com.google.inject.Guice.createInjector(Guice.java:95) at com.google.inject.Guice.createInjector(Guice.java:72) at com.google.inject.Guice.createInjector(Guice.java:62) at my.packagename.hbase_fix.CleanerMapper.setup(CleanerMapper.java:82) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158) 在同一工作中,我与fasterxml有类似的不匹配,因此使用了 maven-shade-plugin 但我在com.google.inject上没有这么成功 <relocations> <relocation> <pattern>com.fasterxml</pattern> <shadedPattern>com.shaded.fasterxml</shadedPattern> <excludes> <exclude>com.fasterxml.*</exclude> </excludes> </relocation> <relocation> <pattern>org.apache.commons.lang</pattern> <shadedPattern>org.shaded.apache.commons.lang</shadedPattern> <excludes> <exclude>org.apache.commons.lang.*</exclude> </excludes> </relocation> <relocation> <pattern>com.google.inject.Binder</pattern> <shadedPattern>com.shaded.google.inject.Binder</shadedPattern> </relocation> <relocation> <pattern>com.google.inject.multibindings</pattern> <shadedPattern>com.shaded.google.inject.multibindings</shadedPattern> </relocation> </relocations> 有没有关于如何在mapreduce作业中使用google.inject获得round类型不匹配的建议?

ijxebb2r

ijxebb2r1#

我不认为有任何简单的解决办法。最后,它不得不迫使mapreduce类路径将guice4的一个副本放在第一位,这样代码才能运行。
不理想,但找到的唯一解决办法

相关问题