The CXF error at startup is as follows:
caused by:com.sun.xml.bind.v2.runtime.illegalannotationsexception:1 counts of Illegalannotationexceptionstwo Classes has 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 was 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 are related to the following location: at Com.shengpay.masopen.facade.service.jaxws _asm. Verifyresponse
The hints are clear:
Both classes have the same XML type name "{http://service.facade.masopen.shengpay.com/}verifyresponse"
There are two class names =verifyresponse XML type name
The processing scheme given is
Use @XmlType. Name and @XmlType. Namespace to assign different names to them.
Use @xmltype's name and namespace to make a distinction
Originally, WebService at the time of release: to WebService inside each method generates a class, the generated class name is: methodName
+ "Response",所以就回导致生成的类和原来的类有两个相同的xml type。
See Interface definition:
@WebService Public Interface Realnameverifyservice { /** * Real-name authentication processing ... @param Request @return */ Throws Businessexception ;}
The method name is verify, the return value is Verifyresponse, and Webswevice will generate a class verifyresponse for my method, which is a conflict.
There are two commonly used solutions:
1. Modify the Return object name and no longer use the Verifyresponse class name
2. Use @webmethod to specify the generated class name
@WebService Public Interface Realnameverifyservice { /** * Real-name authentication processing ... @param Request @return */ @WebMethod (OperationName= "wsverify") throws businessexception;}
Reference:
Http://stackoverflow.com/questions/4254334/illegalannotationexception-two-classes-have-the-same-xml-type-name
http://asialee.iteye.com/blog/1913480
CXF error [1 counts of illegalannotationexceptions]and[two classes has the same XML type Name]and[use @XmlType. Name and @XmlTy Pe.namespace to assign different names to them]