java.lang.NoClassDefFoundError:org/apache/commons/collections/Transformer [英] java.lang.NoClassDefFoundError: org/apache/commons/collections/Transformer

查看:48
本文介绍了java.lang.NoClassDefFoundError:org/apache/commons/collections/Transformer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误 java.lang.NoClassDefFoundError:org/apache/commons/collections/Transformer 尝试使用Apache Commons BeanUtils库中的 BeanMap .

它是从以下代码生成的: BeanMap studentBeanMap = new BeanMap(cohortStudentData.get(row)); 其中 cohortStudentData 是bean的列表.

我正在使用来自Apache DBUtils的 BeanListHandler 来形成数据库中的bean列表.

我从站点),则您使用的是commons-collections-4.4.0.jar.如果您打算使用apache jar的世界,则需要确保它们都兼容.

I am receiving the following error java.lang.NoClassDefFoundError: org/apache/commons/collections/Transformer trying to use BeanMap from the Apache Commons BeanUtils library.

It is generated from the following code: BeanMap studentBeanMap = new BeanMap(cohortStudentData.get(row)); where cohortStudentData is a list of beans.

I am using BeanListHandler from Apache DBUtils to form the list of beans from a database.

I understand from this and this bug report that BeanMap is dependant on the Apache Collections framework. However, I have imported all relevant libraries into my project and into my class, as you can see below:

Does anyone know why this might be happening?

解决方案

I am not really sure, but i think your error is because of jar versions. Lately apache has changed the package of the new versions of their jars because they implement new functionality or something that is not fully backward compatible. For example the jar commons-beanutils-1.9.2.jar depends on commons-collections-3.2.1.jar (according to this site) and you are using commons-collections-4.4.0.jar. If you are planning using the universe of apache jars, you need to be sure that they are all compatible.

这篇关于java.lang.NoClassDefFoundError:org/apache/commons/collections/Transformer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆