webservice cxf error:类的两个属性具有相同名称 "password"
execption detail:
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:369)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1614)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1485)
... 42 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:332)
at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:478)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:690)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:540)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:252)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:205)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)
at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:454)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:334)
... 51 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
类的两个属性具有相同名称 "appno"
this problem is related to the following location:
at public java.lang.String com.taiping.svc.bean.CardPasswardCheckMessageDTO.getAppno()
at com.taiping.svc.bean.CardPasswardCheckMessageDTO
at private com.taiping.svc.bean.CardPasswardCheckMessageDTO com.taiping.svc.webservice.jaxws_asm.CardPasswardCheck.cardPasswardCheckMessageDTO
at com.taiping.svc.webservice.jaxws_asm.CardPasswardCheck
this problem is related to the following location:
at protected java.lang.String com.taiping.svc.bean.CardPasswardCheckMessageDTO.appno
at com.taiping.svc.bean.CardPasswardCheckMessageDTO
at private com.taiping.svc.bean.CardPasswardCheckMessageDTO com.taiping.svc.webservice.jaxws_asm.CardPasswardCheck.cardPasswardCheckMessageDTO
at com.taiping.svc.webservice.jaxws_asm.CardPasswardCheck
类的两个属性具有相同名称 "password"
this problem is related to the following location:
at public java.lang.String com.taiping.svc.bean.CardPasswardCheckMessageDTO.getPassword()
at com.taiping.svc.bean.CardPasswardCheckMessageDTO
at private com.taiping.svc.bean.CardPasswardCheckMessageDTO com.taiping.svc.webservice.jaxws_asm.CardPasswardCheck.cardPasswardCheckMessageDTO
at com.taiping.svc.webservice.jaxws_asm.CardPasswardCheck
this problem is related to the following location:
at protected java.lang.String com.taiping.svc.bean.CardPasswardCheckMessageDTO.password
at com.taiping.svc.bean.CardPasswardCheckMessageDTO
at private com.taiping.svc.bean.CardPasswardCheckMessageDTO com.taiping.svc.webservice.jaxws_asm.CardPasswardCheck.cardPasswardCheckMessageDTO
at com.taiping.svc.webservice.jaxws_asm.CardPasswardCheck
解决方法:
com.taiping.svc.bean.CardPasswardCheckMessageDTO
该类本来是这么定义的:
@XmlRootElement(name = "REQUEST")
public class CardPasswardCheckMessageDTO { @XmlElement(name = "app_no")
protected String appno; @XmlElement(name = "password")
protected String password; public String getAppno() {
return appno;
} public void setAppno(String appno) {
this.appno = appno;
} public String getPassword() {
return password;
} public void setPassword(String password) {
this.password = password;
}
}
改为:
@XmlRootElement(name = "REQUEST")
public class CardPasswardCheckMessageDTO { protected String appno; protected String password; public String getAppno() {
return appno;
} @XmlElement(name = "app_no")
public void setAppno(String appno) {
this.appno = appno;
} public String getPassword() {
return password;
} @XmlElement(name = "password")
public void setPassword(String password) {
this.password = password;
}
}
马上OK!
webservice cxf error:类的两个属性具有相同名称 "password"的更多相关文章
- JAXB "有两个名为 "**" 的属性,类的两个属性具有相同名称 "**""解决方案
这里说的名称冲突指的是: JavaBean 属性名称与字段名称之间的名称冲突.在pojo类中的setter和getter方法会导致运行报错:Exception in thread "main ...
- srping mvc 集成CXF 导致类初始化两遍
cxf依赖于spring的ContextLoaderListener,而spring mvc 则依赖于DispatcherServlet. 初始化DispatcherServlet的时候会依赖初始化一 ...
- webservice cxf error:org.apache.cxf.interceptor.Fault: Unmarshalling Error: 意外的元素 (uri:"", local:"ca
服务器端webservice接口 需要定义@WebParam,如: public ReturnDTO cardBatchSyn(@WebParam(name = "cardBatchSynM ...
- webservice cxf error:java.lang.IllegalArgumentException: Argument(s) "type" can't be null.
客户端请求DTO和服务器端的DTO定义不一样,客户端必须定义@XmlAccessorType和@XmlType,如: @XmlAccessorType(XmlAccessType.FIELD) @Xm ...
- 定义一个复数(z=x+iy)类Complex,包含: 两个属性:实部x和虚部y 默认构造函数 Complex(),设置x=0,y=0 构造函数:Complex(int i,int j) 显示复数的方法:showComp()将其显示为如: 5+8i或5-8i 的形式。 求两个复数的和的方法:(参数是两个复数类对象,返回值是复数类对象)public Complex addComp(Compl
因标题框有限,题目未显示完整,以下再放一份: 定义一个复数(z=x+iy)类Complex,包含: 两个属性:实部x和虚部y 默认构造函数 Complex(),设置x=0,y=0 构造函数:Compl ...
- webservice(CXF)基于3.1.1版本实例
引言 有没有一种办法可以实现跨应用程序进行通信和跨平台进行通信呢? 换句话说,就是有什么办法可以实现我的应用程序 A 可以和应用程序 B 进行通信呢? 或者说是,我用 Java 写的应用程序和用 . ...
- webservice -- cxf客户端调用axis2服务端
背景: 有个项目, 需要由第三方提供用户信息, 实现用户同步操作, 对方给提供webservice接口(axis2实现)并也使用axis2作主客户端调用我方提供的webservice接口 起初, 由于 ...
- 3.3 C++改变基类成员在派生类中的访问属性
参考:http://www.weixueyuan.net/view/6360.html 总结: 使用using声明可以改变基类成员在派生类中的访问属性. private: using book::se ...
- WebService—CXF—实现接口发布和客户端调用
(一)接口发布的几种方式 定义接口: @WebService(targetNamespace="http://www.itfad.net/queryUser") public in ...
随机推荐
- Q promise的使用
虽然es6已经出现一段时间了,但是对于没有使用es6的node.js的时候,仍要解决回调金字塔,因此Q还是很有必要的.
- git 入门 2
进入d盘,新建project文件, 右键,git bash here cd project 初始化 $ git init 克隆项目 $ git clone http://192.168.1.188:3 ...
- eclipse报jvm terminated.exitcode=2异常解决办法
由于安转了oracle,而oracle又自带了jdk,版本好像是1.1的,冲突了.具体可以查看path值.解决方法:删掉oracle的,或者是将oralce的path配置项移到java的配置项后面,建 ...
- shell中引用其他脚本的方法
在Shell中引用其他脚本的方法是source filename.sh 或 . filename.sh 注意: . 和 filename.sh之间必须有空格
- [PCL]1 PCL点云库安装
1.安装文件下载:官网,我还是比较喜欢别人编译好的安装包啊,哈哈. http://www.pointclouds.org/downloads/windows.html 2.傻瓜式安装(下面的依赖项都集 ...
- Excessive AWR Growth From Partitioned Objects Such as SYS.WRH$_EVENT_HISTOGRAM Causing Sysaux to Grow
AWR数据增长较快,导致sysaux表空间使用较高 SQL> select f.tablespace_name, 2 a.total, 3 f.free, 4 round((f.free / a ...
- 学习OpenCV——用OpenCv画漫画
闲的时候用OpenCV画漫画也挺有意思,虽然效果不好(达不到上面所实现的效果), 参数需要调整,还是大头贴而且噪声小的图像比较合适 而且可以熟悉一下关于各种滤波的操作比如:双边滤波: #include ...
- 在Adobe AIR/AS 程序中 如何设置目录
首先所有目录都以 "File:///"开头,无论Mac或者Windows 后面的路径 Windows: E:/WorkGround/Txt.txt --> "Fi ...
- 序列变换(hdu5248)
序列变换 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- 【Origin】晨起忆梦
昨夜有梦又还乡, 忆起少年儿郎样: 田畔有花不忍折, 岁岁年年观花放. -作于二零一五年八月四日