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
本文解决在使用JAX-WS2.2规范的CXF框架时,面对Java6环境不支持JAX-WS2.2规范导致的构造函数无法生成的问题。提供了一个替代解决方案,通过删除endorsed目录下的api jars,使得wsdl2java工具能自动切换生成符合JAX-WS2.1规范的代码。同时,介绍了一个新选项wsdl2java-frontendjaxws21,用于指定使用JAX-WS2.1兼容的前端。
3860

被折叠的 条评论
为什么被折叠?



