CXF报错[1 counts of IllegalAnnotationExceptions]and[Two classes have the same XML type name]and[Use @XmlType.name and @XmlType.namespace to assign different names to them]
启动时CXF报错如下:
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
Two classes have the same XML type name "{http://service.facade.masopen.shengpay.com/}verifyResponse". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at com.shengpay.masopen.facade.model.verify.VerifyResponse
at private com.shengpay.masopen.facade.model.verify.VerifyResponse com.shengpay.masopen.facade.service.jaxws_asm.VerifyResponse._return
at com.shengpay.masopen.facade.service.jaxws_asm.VerifyResponse
this problem is related to the following location:
at com.shengpay.masopen.facade.service.jaxws_asm.VerifyResponse
提示很明确:
Two classes have the same XML type name "{http://service.facade.masopen.shengpay.com/}verifyResponse"
存在两个类名=verifyResponse的xml type name
给出的处理方案是
Use @XmlType.name and @XmlType.namespace to assign different names to them.
使用@xmlType的name和namespace做区分
原来,WebService在发布的时候:对webservice里面得每个方法都生成一个类,生成的类名为: methodName + "Response",所以就回导致生成的类和原来的类有两个相同的xml type。
请看接口定义:
@WebService
public interface RealNameVerifyService {
/**
* 实名认证处理...
* @param request
* @return
*/ VerifyResponse verify(VerifyRequest request) throws BusinessException;
}
方法名是verify,返回值是VerifyResponse,而webSwevice也会为我的方法生成一个类verifyResponse,这就冲突了。
解决方案常用有两个:
1.修改返回对象名称,不再使用VerifyResponse类名
2.使用@WebMethod指定生成的类名
@WebService
public interface RealNameVerifyService {
/**
* 实名认证处理...
* @param request
* @return
*/
@WebMethod(operationName="wsVerify")
VerifyResponse verify(VerifyRequest request) throws BusinessException;
}

参考:
http://stackoverflow.com/questions/4254334/illegalannotationexception-two-classes-have-the-same-xml-type-name
http://asialee.iteye.com/blog/1913480
CXF报错[1 counts of IllegalAnnotationExceptions]and[Two classes have the same XML type name]and[Use @XmlType.name and @XmlType.namespace to assign different names to them]的更多相关文章
- weblogic 整合cxf 报错:cannot create a secure XmlInputFactory
weblogic 整合cxf 报错:cannot create a secure XmlInputFactory ================================ ©Copyright ...
- 关于SpringMVC项目报错:java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/xxxx.xml]
关于SpringMVC项目报错:java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/xxxx ...
- SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found."
SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'c ...
- 【Webservice】2 counts of IllegalAnnotationExceptions Two classes have the same XML type name
在使用客户端调用服务端的时候发生了2 counts of IllegalAnnotationExceptions Two classes have the same XML type name的错误, ...
- cxf报错 Cannot find any registered HttpDestinationFactory from the Bus.
错误信息:Cannot find any registered HttpDestinationFactory from the Bus. 报错主要是因为缺少jetty依赖 一般添加如下依赖即可 < ...
- eclipse 运行 mapreduce程序报错 No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
报错信息 17/07/06 17:00:27 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Ap ...
- 2. springboot启动报错:Field userMapper in com.service.UserService required a bean of type 'com.dao.UserMapper' that could not be found.
报错信息: 2018-06-25 14:26:17.103 WARN 49752 --- [ restartedMain] ationConfigEmbeddedWebApplicationCon ...
- java 反射 报错:Attempt to get java.lang.Integer field "..." with illegal data type conversion to int
类: Integer id; 反射时: Field f = User.class.getDeclaredField("id"); f.setAccessible(true); in ...
- 报错分析---->jsp自定义标签:类cannot be resolved to a type
这个困扰我一个晚上,仔细上网查阅发现,主要是因为jsp自定义标签要用到的这个jsp-api.jar的问题 这是我eclipes中的jar: 然而jsp-api.jar这个jar在tomcat中也有(报 ...
随机推荐
- [转]使用Node.js完成的第一个项目的实践总结
本文转自:http://blog.csdn.net/yanghua_kobe/article/details/17199417 https://github.com/yanghua/FixedAsse ...
- (转)Linux命令之md5sum
Linux命令之md5sum 原文:https://www.cnblogs.com/zhuxiaohou110908/p/5786893.html 1. 背景 在网络传输.设备之间转存.复制大文件等 ...
- Python3实现计算BMI指数,跟我一起来计算你的BMI吧
废话不多说,直接上程序哈: name=input('Name:') height=input('Height(m):') weight=input('Weight(kg):') BMI=float(f ...
- [DDD]學習筆記 第15章 精煉(Distillation)
核心領域(Core-Domain) 為了使領域模型成為企業真正的資產, 模型中的關鍵核心部份需要足夠靈活和充分利用來創建應用程序的功能; 簡而言之, 核心領域是系統中最有價值的部份. 濃縮模型, 將最 ...
- Facebook TSDB论文Gorilla分析
Facebook TSDB论文Gorilla分析 背景 TSDB时序数据库用于存储时间相关的数据,常用于监控系统的数据存储,分布式的TSDB提供了海量的数据存储能力,如InfluxDB.OpenTSD ...
- Java中的阻塞队列-SynchronousQueue
SynchronousQueue是一个不存储元素的阻塞队列.每一个put操作必须等待一个take操作,否则不能继续添加元素.SynchronousQueue可以看成是一个传球手,负责把生产者线程处理的 ...
- yield关键字的使用
yield的中文是什么意思呢? 在金山词霸上面的翻译是: vt.屈服,投降: 生产: 获利: 不再反对 vi.放弃,屈服: 生利: 退让,退位 n.产量,产额: 投资的收益: 屈服,击穿: 产品 个人 ...
- http头部如何对缓存的控制
文章自于我的个人博客 使用缓存的目的就是在于减少计算,IO,网络等时间,可以快速的返回,特别是流量比较大的时候,可以节约很多服务器带宽和压力. 一个请求从缓存的方面来说,有三个过程. 本地检查缓存是否 ...
- Debug view 是个好工具
有时候不用 VS 调试, 在 代码里面加入 Debug.Writeline(" Debug information!!"); 这个时候打开 debug view 就可以检测出输出 ...
- Azure资源模板化部署,伦家不懒都不好意思了
如果老板让你在云平台上部署一套系统,你准备怎么做? 嗯,估计得根据具体需求开通或创建一大堆东西:虚拟机.存储.数据库.虚拟网络……别急还没完,接着还要对这些东西的规模.配置等各方面调整和优化.一系列环 ...