IllegalAnnotationExceptions on Jaxb-generated fault class.
Hi everyone, I'm having some problems on a fault class generated by Jaxb.
When trying to start the service, I get an "IllegalAnnotationExceptions".
The excerpt of the xsd is the following:
Code:
<xs:complexType name="ConfigurationFaultType">
<xs:sequence>
<xs:annotation>
<xs:documentation>
It is required that every ServiceUrl that is missing, contains a duplicate, or does not resolve to a
reachable service will be indicated in the ErroneousElement array.
</xs:documentation>
</xs:annotation>
<xs:element name="Message" type="xs:string"/>
<xs:element name="ErroneousElement" type="tns:ConfigurationEndpointRole" minOccurs="0" maxOccurs="8"/>
</xs:sequence>
<xs:attribute ref="s:mustUnderstand"/>
</xs:complexType>
The generated class is:
Code:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ConfigurationFaultType", namespace = "http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Configuration.xsd", propOrder = {
"message",
"erroneousElement"
})
public class ConfigurationFaultType extends Exception
{
/**
*
*/
private static final long serialVersionUID = 1L;
@XmlElement(name = "Message", required = true)
protected String message;
@XmlElement(name = "ErroneousElement")
protected List<ConfigurationEndpointRole> erroneousElement;
@XmlAttribute(name = "mustUnderstand", namespace = "http://schemas.xmlsoap.org/soap/envelope/")
@XmlJavaTypeAdapter(ZeroOneBooleanAdapter.class)
protected Boolean mustUnderstand;
...
...
... (cut-off constructors, getters and setters to shorten)
...
I then added "@WebFault" and "@XmlRootElement" spring tags, but that didn't solve the problem.
The applicable ObjectFactory's code follows:
Code:
/**
* Create an instance of {@link ConfigurationFaultType }
*
*/
public ConfigurationFaultType createConfigurationFaultType() {
return new ConfigurationFaultType();
}
The error I'm getting is the following one:
Code:
Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
java.lang.StackTraceElement does not have a no-arg default constructor.
this problem is related to the following location:
at java.lang.StackTraceElement
at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
at java.lang.Throwable
at java.lang.Exception
at com.mycompany.hr.manufacturer.types.configuration.ConfigurationFaultType
at public com.mycompany.hr.manufacturer.types.configuration.ConfigurationFaultType com.mycompany.hr.manufacturer.types.configuration.ObjectFactory.createConfigurationFaultType()
at com.mycompany.hr.manufacturer.types.configuration.ObjectFactory
and I don't know how to get rid of it. I need this class to extend java.lang.Exception (it is legacy code), so I don't know how to take this error away.
Any pointer/hint/solution will be greatly appreciated.
Best regards,
JP