我是靠谱客的博主 碧蓝书本,最近开发中收集的这篇文章主要介绍hbase 使用disruptor_HBase和Kryo混合使用时出现的jar包冲突,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

HBase 1.1.2 + Kryo 4.0.1组合使用,kryo将数据序列化为byte数组后入到HBase中,查询程序将HBase取出来后,调用Kryo反序列化,突然出现了下面的错误,出现了jar包版本冲突了

Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface org.objectweb.asm.MethodVisitor, but class was expected

at com.esotericsoftware.reflectasm.ConstructorAccess.insertConstructor(ConstructorAccess.java:128)

at com.esotericsoftware.reflectasm.ConstructorAccess.get(ConstructorAccess.java:98)

at com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.newInstantiatorOf(Kryo.java:1271)

at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1127)

at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1136)

at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:562)

at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:538)

at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813)

at com.yuewen.data.util.KryoUtil.readFromByte(KryoUtil.java:52)

at com.yuewen.data.Query.main(Query.java:37)

通过mvn dependency:tree命令查看依赖树结果如下:

[INFO] +- org.apache.hbase:hbase-server:jar:1.1.2:compile

[INFO] | +- org.apache.hbase:hbase-procedure:jar:1.1.2:compile

[INFO] | | - org.apache.hbase:hbase-common:jar:tests:1.1.2:compile

[INFO] | +- org.apache.hbase:hbase-prefix-tree:jar:1.1.2:runtime

[INFO] | +- commons-httpclient:commons-httpclient:jar:3.1:compile

[INFO] | +- commons-collections:commons-collections:jar:3.2.1:compile

[INFO] | +- org.apache.hbase:hbase-hadoop-compat:jar:1.1.2:compile

[INFO] | +- org.apache.hbase:hbase-hadoop2-compat:jar:1.1.2:compile

[INFO] | +- com.yammer.metrics:metrics-core:jar:2.2.0:compile

[INFO] | +- com.sun.jersey:jersey-core:jar:1.9:compile

[INFO] | +- com.sun.jersey:jersey-server:jar:1.9:compile

[INFO] | | - asm:asm:jar:3.1:compile

[INFO] | +- commons-cli:commons-cli:jar:1.2:compile

[INFO] | +- org.apache.commons:commons-math:jar:2.2:compile

[INFO] | +- org.mortbay.jetty:jetty:jar:6.1.26:compile

[INFO] | +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile

[INFO] | +- org.mortbay.jetty:jetty-sslengine:jar:6.1.26:compile

[INFO] | +- org.mortbay.jetty:jsp-2.1:jar:6.1.14:compile

[INFO] | +- org.mortbay.jetty:jsp-api-2.1:jar:6.1.14:compile

[INFO] | +- org.mortbay.jetty:servlet-api-2.5:jar:6.1.14:compile

[INFO] | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile

[INFO] | +- org.codehaus.jackson:jackson-jaxrs:jar:1.9.13:compile

[INFO] | +- tomcat:jasper-compiler:jar:5.5.23:compile

[INFO] | +- tomcat:jasper-runtime:jar:5.5.23:compile

[INFO] | +- org.jamon:jamon-runtime:jar:2.3.1:compile

[INFO] | +- com.lmax:disruptor:jar:3.3.0:compile

[INFO] | +- org.apache.hadoop:hadoop-client:jar:2.5.1:compile

[INFO] | | +- org.apache.hadoop:hadoop-mapreduce-client-app:jar:2.5.1:compile

[INFO] | | | +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.5.1:compile

[INFO] | | | | +- org.apache.hadoop:hadoop-yarn-client:jar:2.5.1:compile

[INFO] | | | | | - com.sun.jersey:jersey-client:jar:1.9:compile

[INFO] | | | | - org.apache.hadoop:hadoop-yarn-server-common:jar:2.5.1:compile

[INFO] | | | - org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.5.1:compile

[INFO] | | | - org.fusesource.leveldbjni:leveldbjni-all:jar:1.8:compile

[INFO] | | +- org.apache.hadoop:hadoop-yarn-api:jar:2.5.1:compile

[INFO] | | - org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.5.1:compile

[INFO] | - org.apache.hadoop:hadoop-hdfs:jar:2.5.1:compile

[INFO] | - commons-daemon:commons-daemon:jar:1.0.13:compile

[INFO] +- com.esotericsoftware:kryo:jar:4.0.1:compile

[INFO] | +- com.esotericsoftware:minlog:jar:1.3.0:compile

[INFO] | - org.objenesis:objenesis:jar:2.5.1:compile

[INFO] +- com.esotericsoftware:reflectasm:jar:1.11.3:compile

[INFO] - org.ow2.asm:asm:jar:6.0:compile

hbase-server的jar包和kryo的reflectasm依赖之间存在asm字节码包之间的冲突,解决方案是在hbase-server中,去除对低版本asm字节码解析包的依赖:

org.apache.hbase

hbase-server

1.1.2

asm

asm

最后

以上就是碧蓝书本为你收集整理的hbase 使用disruptor_HBase和Kryo混合使用时出现的jar包冲突的全部内容,希望文章能够帮你解决hbase 使用disruptor_HBase和Kryo混合使用时出现的jar包冲突所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(45)

评论列表共有 0 条评论

立即
投稿
返回
顶部