Hi,
I am returning a custom exception as part of my web service method.
@WebService
public class PingService {
@WebMethod
public CustomException getException() {
}
@WebMethod
public void ping() {
}
}
My CustomException class looks like:
public class CustomException extends Exception {
}
I was looking at the bug report
https://jaxb.dev.java.net/issues/show_bug.cgi?id=216. But, not sure if
this supports custom exceptions.
I tried using
@XmlTransient
public class CustomException extends Exception {
}
But, I still get the ServiceConstructionException :
Caused by: com.sun.xml.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 java.io.IOException
I have asked the same question in JAXB forum as it is more relevant
there, but not sure if I will get a response as that forum is mostly
inactive.
I appreciate if someone could clarify this behavior.
Thanks!
Arul