Announcement Announcement Module
Collapse
No announcement yet.
IllegalAnnotationExceptions on Jaxb-generated fault class. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    Any solution yet?

    Hello jpsilvagallino,
    Have you found the solution to your problem
    because I'm having exactly the same with my code...

    Thanks for any help!

    Comment


    • #3
      Hi ikolokou. Well, I did, but is well over a year now, so I don't remember correctly.
      I would suggest starting a brand new project and re-generating, that solved many of my problems (not sure if this one in particular, though).

      I'm sorry I can not be of much help.
      Hope you find a solution.
      Regards,
      JP

      Comment


      • #4
        Thanks

        Thanks anyway jpsilvagallino.
        I'll try a fresh project.

        Regards,
        ikolokou

        Comment

        Working...
        X