我目前正在编写一个Apache Camel项目,该项目使用CXF公开一些REST端点,并使用Kie Remote Client与BPMS进行交互。但是,当我尝试将Kie Remote Client依赖项包含到我的pom文件中时,我遇到了依赖项冲突(不确定如何描述它)。
这是我目前的pom文件:
<dependencies>
<!-- Camel Dependencies -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jackson</artifactId>
<version>2.15.2</version>
</dependency>
<!-- Spring Web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.12</version>
</dependency>
<!-- <dependency>
<groupId>org.kie</groupId>
<artifactId>kie-parent-with-dependencies</artifactId>
<version>6.2.0.Final-redhat-4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.kie.remote</groupId>
<artifactId>kie-remote-client </artifactId>
<version>6.2.0.Final-redhat-4</version>
<scope>provided</scope>
</dependency> -->
</dependencies>
当我尝试部署我的项目时,我遇到了一些属性异常:
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (2) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'serviceBeans' threw exception; nested exception is java.lang.NoSuchMethodError: org.apache.cxf.jaxrs.JAXRSServerFactoryBean.addToBeans(Ljava/util/Collection;Ljava/lang/Object;)V
PropertyAccessException 2: org.springframework.beans.MethodInvocationException: Property 'providers' threw exception; nested exception is java.lang.NoSuchMethodError: org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean.addToBeans(Ljava/util/Collection;Lj ava/lang/Object;)V
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractProp ertyAccessor.java:121) [spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75) [spring-beans-4.1.6.RELEASE.jar:4.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.appl yPropertyValues(AbstractAutowireCapableBeanFactory.java:1510) [spring-beans- 4.1.6.RELEASE.jar:4.1.6
任何人都知道这个错误的根本原因是什么?谢谢!
编辑:我确实找到了解决此问题的临时解决方法。如果我将我的骆驼版本降级到2.13.2并将我的spring版本降级到3.2.8-RELEASE,那么apache-cxf版本似乎相似。然而,我想在2.15.2中提供许多我需要的新功能。有人知道kie.remote.client的任何好的替代品吗?答案 0 :(得分:0)
Kie远程客户端添加jaxb-impl-2.2.5.jar依赖项,与cxf中的jaxb-core-2.2.11.jar和jaxb-impl-2.2.11.jar相匹配。
从部署中删除jaxb-impl。 (或者使用依赖于kie-client的maven排除)它对我有用。