猿问

将 JAXWS 应用程序从 Java 8 迁移到 Java 11

我正在寻找org.apache.cxf:cxf-spring-boot-starter-jaxws与Java 10+上的jaxws-api/兼容的组合jaxws-ri。


我们的应用程序在 Java 8 上运行良好。


同样在 Java 9 和 10 上使用--add-modules=java.se.ee.


但是,当我删除此选项并添加以下依赖项时:


compile group: 'javax.xml.ws', name: 'jaxws-api', version: '2.3.0'

compile group: 'com.sun.xml.ws', name: 'jaxws-ri', version: '2.3.0.2', ext: 'pom'

compile group: 'com.sun.xml.ws', name: 'jaxws-rt', version: '2.3.0.2', ext: 'pom'

常见依赖项(在 java 9/10 或 java 8 中有/没有 --add-modules):


compile('org.apache.cxf:cxf-spring-boot-starter-jaxws:3.2.6')

我变得:


Caused by: java.lang.NoSuchMethodError: javax.jws.WebMethod.exclude()Z

    at org.apache.cxf.jaxws.support.JaxWsServiceConfiguration.isOperation(JaxWsServiceConfiguration.java:190)

    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.isValidMethod(ReflectionServiceFactoryBean.java:1962)

    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.createInterface(ReflectionServiceFactoryBean.java:999)

    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:461)

    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:695)

    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:530)

    at org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:263)

    at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)

    at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)

    at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:168)

    at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)



青春有我
浏览 188回答 2
2回答
随时随地看视频慕课网APP

相关分类

Java
我要回答