Eclipse報錯:java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap

場景:在練習shiro 的時候,導入了commons-beanutils-1.9.3.jar 和 commons-logging-1.2.jar ,啓動tomcat 報錯:java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap 和

this web application instance has been stopped already. Could not load .... 錯誤

原因: org.apache.commons.beanutils.PropertyUtilsBean.getMappedProperty這個方法, 需要使用 一個名叫 org.apache.commons.collections.FastHashMap 的類,這個類是 commons-collections jar裏面的.

commons-beanutils 的依賴關係,如下圖:




解決方法:往工程加入commons-collections-3.2.jar包

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章