【问题标题】:Error running CXF REST web service on Apache Tomee在 Apache Tomee 上运行 CXF REST Web 服务时出错
【发布时间】:2016-10-01 15:52:55
【问题描述】:

我正在尝试使用“org.apache.cxf.archetype:cxf-jaxrs-service”maven 原型构建一个 RESTful Web 服务。当我在 Apache Tomee 上部署它时,出现以下错误:

严重:上下文初始化失败 org.springframework.beans.factory.BeanCreationException:创建名为“服务”的bean时出错:调用init方法失败;嵌套异常是 org.apache.cxf.service.factory.ServiceConstructionException ... ... 引起:org.apache.cxf.service.factory.ServiceConstructionException 在 org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:219) ... ... 原因:java.lang.ClassCastException:无法将 org.apache.cxf.management.jmx.InstrumentationManagerImpl 转换为 org.apache.cxf.management.InstrumentationManager*

我的猜测是我缺少一些配置,但我认为原型会“正常工作”。

有什么想法吗?

【问题讨论】:

    标签: spring web-services maven cxf apache-tomee


    【解决方案1】:

    此错误表示您在 webapp (WEB-INF/lib) 中的 cxf 和 tomee 之间存在冲突。您要么必须配置类加载来执行此操作,要么(由 EE 推荐和期望)只需从 webapp 中删除 CXF,因为它在 tomee 中,而 tomee 会为您完成这项工作。

    附注:您可能还需要清理 web.xml,因为 tomee 将处理部署而不需要注册 servlet。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多