1. 程式人生 > >java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap報錯解決辦法

java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap報錯解決辦法

在編寫Servlet中實現表單值自動填充的程式中,出現了-500 java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap報錯,究其原因就是在commons-collection-4.X以上的包中不存在FastHashMap方法,解決方案也很簡單,替換成commons-collection-3.2版本的包就可以,同時應當重啟Tomcat。

目前測試可以使用的BeanUtils依賴包版本是:

BeanUtil-1.9.3 +

Collection-3.2.2 +

logging-1.2

下載地址是:

http://commons.apache.org