Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
503 views
in Technique[技术] by (71.8m points)

runtime error - java.lang.NoClassDefFoundError: org/apache/commons/collections/Transformer

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:

External Library List

Import Statements

Does anyone know why this might be happening?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...