升级hbase-client报错 java.lang.NoClassDefFoundError: org/apache/commons/collections/map/UnmodifiableMap

最近把一个操作hbase的项目 hbase-client 从 0.98 升级到 1.2.0-cdh5.9.0 ,启动项目出现以下错误:

Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections/map/UnmodifiableMap
	at org.apache.hadoop.conf.Configuration$DeprecationContext.(Configuration.java:409)
	at org.apache.hadoop.conf.Configuration.(Configuration.java:449)
	at com.risk.common.service.HBaseConnection.initHbaseConfig(HBaseConnection.java:34)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:354)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:305)
	at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
	... 209 more

网上资料较少,摸索了一下, 去http://www.findjar.com/ 搜索一下
org/apache/commons/collections/map/UnmodifiableMap,发现commons-collections的jar包中存在这个类,而不是commons-collections4中的;
maven中增加


    commons-collections
    commons-collections
    3.2.2

启动 解决此问题;

你可能感兴趣的:(大数据)