方法上有@xmlelementMapping,但它没有返回Jaxbelement的子类型
我正在尝试在 JBOSS EAP 7.2 上部署我的 Web 服务。 但在部署阶段我收到错误。我的 ObjectFactory 类在 createCertificateTypeSerialNumber 方法中没有返回 JAXBElement 吗?
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException:
7 counts of IllegalAnnotationExceptions
The createCertificateTypeSerialNumber method has @XmlElementMapping on it, but it doesn't return a sub-type of JAXBElement. this problem is related to the following location:
at @javax.xml.bind.annotation.XmlElementDecl(namespace=, substitutionHeadName=, substitutionHeadNamespace=##default, defaultValue=, scope=class com.icl.isesb.ws.CertificateType, name=serialNumber)
at public javax.xml.bind.JAXBElement com.icl.isesb.ws.ObjectFactory.createCertificateTypeSerialNumber(java.lang.String)
at com.icl.isesb.ws.ObjectFactory
at protected java.util.List com.icl.isesb.ws.CertificateType.content
at com.icl.isesb.ws.CertificateType
at protected com.icl.isesb.ws.CertificateType com.icl.isesb.ws.GetCertificateResponse.certificate
at com.icl.isesb.ws.GetCertificateResponse
...
我的 ObjectFactory.class:
@XmlRegistry
public class ObjectFactory {
private final static QName _CertificateTypeSerialNumber_QNAME = new QName("", "serialNumber");
private final static QName _CertificateTypeSubjectDN_QNAME = new QName("", "subjectDN");
private final static QName _CertificateTypeIssuerDN_QNAME = new QName("", "issuerDN");
private final static QName _CertificateTypeSubjectKeyIdentifier_QNAME = new QName("", "subjectKeyIdentifier");
private final static QName _CertificateTypeAuthorityKeyIdentifier_QNAME = new QName("", "authorityKeyIdentifier");
private final static QName _CertificateTypeCertString_QNAME = new QName("", "certString");
public ObjectFactory() {
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "serialNumber", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeSerialNumber(String value) {
return new JAXBElement<String>(_CertificateTypeSerialNumber_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "subjectDN", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeSubjectDN(String value) {
return new JAXBElement<String>(_CertificateTypeSubjectDN_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "issuerDN", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeIssuerDN(String value) {
return new JAXBElement<String>(_CertificateTypeIssuerDN_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "subjectKeyIdentifier", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeSubjectKeyIdentifier(String value) {
return new JAXBElement<String>(_CertificateTypeSubjectKeyIdentifier_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "authorityKeyIdentifier", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeAuthorityKeyIdentifier(String value) {
return new JAXBElement<String>(_CertificateTypeAuthorityKeyIdentifier_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "certString", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeCertString(String value) {
return new JAXBElement<String>(_CertificateTypeCertString_QNAME, String.class, CertificateType.class, value);
}
}
我做错了什么?
我尝试将 cxf codegenplugin 更改为 3.5.1
I am trying to deploy my web service on JBOSS EAP 7.2.
But at the deployment stage I get an error. Doesn't my ObjectFactory class return a JAXBElement in the createCertificateTypeSerialNumber method?
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException:
7 counts of IllegalAnnotationExceptions
The createCertificateTypeSerialNumber method has @XmlElementMapping on it, but it doesn't return a sub-type of JAXBElement. this problem is related to the following location:
at @javax.xml.bind.annotation.XmlElementDecl(namespace=, substitutionHeadName=, substitutionHeadNamespace=##default, defaultValue=, scope=class com.icl.isesb.ws.CertificateType, name=serialNumber)
at public javax.xml.bind.JAXBElement com.icl.isesb.ws.ObjectFactory.createCertificateTypeSerialNumber(java.lang.String)
at com.icl.isesb.ws.ObjectFactory
at protected java.util.List com.icl.isesb.ws.CertificateType.content
at com.icl.isesb.ws.CertificateType
at protected com.icl.isesb.ws.CertificateType com.icl.isesb.ws.GetCertificateResponse.certificate
at com.icl.isesb.ws.GetCertificateResponse
...
My ObjectFactory.class:
@XmlRegistry
public class ObjectFactory {
private final static QName _CertificateTypeSerialNumber_QNAME = new QName("", "serialNumber");
private final static QName _CertificateTypeSubjectDN_QNAME = new QName("", "subjectDN");
private final static QName _CertificateTypeIssuerDN_QNAME = new QName("", "issuerDN");
private final static QName _CertificateTypeSubjectKeyIdentifier_QNAME = new QName("", "subjectKeyIdentifier");
private final static QName _CertificateTypeAuthorityKeyIdentifier_QNAME = new QName("", "authorityKeyIdentifier");
private final static QName _CertificateTypeCertString_QNAME = new QName("", "certString");
public ObjectFactory() {
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "serialNumber", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeSerialNumber(String value) {
return new JAXBElement<String>(_CertificateTypeSerialNumber_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "subjectDN", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeSubjectDN(String value) {
return new JAXBElement<String>(_CertificateTypeSubjectDN_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "issuerDN", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeIssuerDN(String value) {
return new JAXBElement<String>(_CertificateTypeIssuerDN_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "subjectKeyIdentifier", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeSubjectKeyIdentifier(String value) {
return new JAXBElement<String>(_CertificateTypeSubjectKeyIdentifier_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "authorityKeyIdentifier", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeAuthorityKeyIdentifier(String value) {
return new JAXBElement<String>(_CertificateTypeAuthorityKeyIdentifier_QNAME, String.class, CertificateType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*
* @param value
* Java instance representing xml element's value.
* @return
* the new instance of {@link JAXBElement }{@code <}{@link String }{@code >}
*/
@XmlElementDecl(namespace = "", name = "certString", scope = CertificateType.class)
public JAXBElement<String> createCertificateTypeCertString(String value) {
return new JAXBElement<String>(_CertificateTypeCertString_QNAME, String.class, CertificateType.class, value);
}
}
what i do wrong?
i try to change cxf codegenplugin to 3.5.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论