springboot下webservice使用cxf jar包报错及解决

之前在spring框架中使用关于webservice的cxf包都使用的是cxf的捆绑包,
现在用的是springboot,发现用了捆绑包中包含有跟spring相冲突的包,所以就只能单独使用几个适合springboot的非捆绑包
http://bbs.csdn.net/topics/392172078
之后在实际调用webservice的时候遇见了几个错误
java.lang.IllegalStateException  Unable to create schema compiler
原因:缺少 jaxb-xjc-2.1.13.jar 或高版本jar包
解决:引入该jar包

java.lang.NoSuchFieldError: REFLECTION
把cxf的版本改为2.7.18之后就好了。好像是因为2.7.18的动态调用比较稳定,之前用的是3.1.16
< dependency >
< groupId > org.apache.cxf </ groupId >
< artifactId > cxf-rt-frontend-jaxws </ artifactId >
< version > 2.7.18 </ version >
</ dependency >
< dependency >
< groupId > org.apache.cxf </ groupId >
< artifactId > cxf-rt-transports-http </ artifactId >
< version > 2.7.18 </ version >
</ dependency >

Client client = dcf.createClient(wsdlURL) 执行到一步报空指针
需要把jre换成jdk下面的jre


所以在最终在springboot中webservice要用到的cxf的所有包为以下3个
 <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>2.7.18</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>2.7.18</version>
    </dependency>
     <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-xjc</artifactId>
        <version>2.1.12</version>
    </dependency> 





  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值