我的項目結構就像有三個軟件包:Rest(其中放置Rest API及其Implementaion類),Service API(其中定義了服務接口)和Service Impl(in服務API的實現被放置)。我的代碼PersonalInfoServiceImpl
只是將PersonalInfoRequestBean
的值設置爲PersonalInfoResponseBean
(+更多屬性)對象並返回PersonalInfoResponseBean
。它工作正常。但隨着幾個攔截器整合後,現在突然我開始在這個代碼以下錯誤:java.lang.LinkageError:加載器約束違例;當解析接口方法時(在服務類中)
Caused by java.lang.LinkageError: loader constraint violation: when resolving
interface method "personal.info.service.api.PersonalInfoService.getPersonalInfoDetails(Lcom//personal/info/model/PersonalInfoRequestBean;)Lpersonal/info/model/PersonalInfoResponseBean;"
the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5)
of the current class, personal/info/rest/impl/PersonalInfoRESTServiceImpl,
and the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5)
for the method's defining class, personal/info/service/api/PersonalInfoService,
have different Class objects for the type personal/info/model/PersonalInfoRequestBean
used in the signature at personal.info.rest.impl.PersonalInfoRESTServiceImpl.getPersonalInfoDetail(PersonalInfoRESTServiceImpl.java:112)
有人可以幫助我在這個問題上?我們使用Apache karaf來部署我們的服務。因此,如果它與karaf/delpoyment/maven依賴關係相關,那麼調試此問題的方法是什麼。