照例將jar檔放進tocmat安裝目錄的lib底下,
並重新啟動tomcat。
但卻遇到NoClassDefFoundError的錯誤。
爬文後才發現,
要讓JsonLib能work,
要在tomcat/lib放入以下jar檔︰
(1)commons-beanutils-1.7.0.jar(http://commons.apache.org/index.html取得,見圖1)
(2)commons-httpclient-3.1.jar (http://www.docjar.com/搜尋關鍵字httpclient用jar檔搜尋取得)
(3)commons-lang-2.3.jar (http://commons.apache.org/index.html取得,要抓2.6版。3.1版仍會報找不到class的錯)
(4)commons-logging-1.0.4.jar (http://commons.apache.org/index.html取得)
(5)commons-collections-3.1.jar (http://commons.apache.org/index.html取得)
(6)ezmorph-1.0.3.jar(http://ezmorph.sourceforge.net/取得)
(7)json-lib-2.3-jdk15.jar(http://json-lib.sourceforge.net/取得)
才能正常運作Json
圖1 beanutils下載連結點 |
java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher
java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ListOrderedMap
java.lang.NoClassDefFoundError: org/apache/commons/beanutils/DynaBean
java.lang.NoClassDefFoundError: org/apache/commons/codec/DecoderException
java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory