我尝试使用apache CXF和Spring创建简单的Web服务。版本
<cxf.version>3.1.7</cxf.version>
<spring.version>4.3.8.RELEASE</spring.version>
我所指的教程是here
我的cxf-servlet.xml
文件看起来像
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:endpoint id="sayHelloEndpoint"
implementor="com.kaushik.winnersoft.serverside.impl.HelloWorldImpl" address="http://localhost:8080/services/sayHelloService" />
</beans>
我收到以下错误
WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sayHelloEndpoint': Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: REFLECTION
May 28, 2017 12:06:41 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sayHelloEndpoint': Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: REFLECTION
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)