項目中採用cxf發佈webservice,在同一osgi環境下寫測試類發現能夠正常運行,但經過發佈成webservice後,用工程調用報如下異常:
org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one
version of 'org.apache.commons.logging.Log' visible, which is not allowed.
根據報出的異常可以看出是日誌包的衝突,最後查出是在客戶端調用的項目中也引入了apache的commons-logging包或者是與commons-logging相關的日誌包:slf4j,log4j等