cxf下的Service(URL, QName, WebServiceFeature[]) is undefined

Service(URL, QName, WebServiceFeature[]) is undefined 

原因是CXF自带的javax.xml.service 版本高过 jdk的javax.xml.service。 

一个解决办法是: 

在使用wsdl2java时,加入参数 -frontend jaxws21 

这个问题的消息解释可以在这里看到 : 



http://david-commerce.iteye.com/blog/978313:

I'm marking this as "not a problem" as the generated code is correct per spec. CXF 2.3.2 is a JAX-WS 2.2 compliant implementation and thus must generate code compliant to the JAX-WS 2.2 specification which requires those constructors like that. HOWEVER, to compile them on Java 6, you will likely need to endorse the 2.2 jaxws-api jar (and likely the jaxb-api jar as well). See the 2.3 migration guide: http://cxf.apache.org/docs/23-migration-guide.html for some details about the endorsed stuff.

The alternative workaround, right now, is to delete the api jars from lib/endorsed. In that case, wsdl2java will detect that the 2.2 versions are not available/endorsed and will switch to generating 2.1 compliant code.

I also just added a new frontend (will be there for 2.3.3) to force 2.1 behavior. With 2.3.3, you'll be able to do "wsdl2java -frontend jaxws21" to tell it to use the JAX-WS 2.1 compliant frontend instead.

 

 

解决办法:

 

Alternative workaround you recommended works great!

"wsdl2java -frontend jaxws21" sounds better to me. I think it will be an important new feature to CXF as not many organisations may have moved past Java6 and would like to have jaxws_2.1


  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值