【发布时间】:2016-08-10 06:48:23
【问题描述】:
我的项目结构就像是三个包,即 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依赖有关,那么调试这个问题的方法是什么。
【问题讨论】:
标签: jakarta-ee jax-rs karaf linkageerror