我的项目结构就像有三个包,即 Rest(其中放置了 Rest API 及其实现类)、Service API(其中定义了服务接口)和 Service Impl(其中放置了 Service API 的实现)。我的代码PersonalInfoServiceImpl
只是将PersonalInfoRequestBean
值设置为PersonalInfoResponseBean
(+几个属性)对象并返回PersonalInfoResponseBean
. 它工作正常。但是在与更多的拦截器集成之后,现在我突然开始在这段代码中收到以下错误:
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 依赖项有关,那么调试此问题的方法是什么。