我有一个带有方法的web服务,可以抛出我的自定义exeption。
@WebMethod void someMethod(...) throws MyException
MyException
类的注释为
@ApplicationException
@ApplicationException
class public MyException extends Exception {...}
我使用
maven
,
JDK 1.6
和
jaxws-maven-plugin
用于生成WSDL,并且都运行良好。
但现在我想对
JDK 1.7
,现在我出错了
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 private java.lang.Throwable[] com.MyPackage.MyExceptionBean.suppressed
at com.MyPackage.MyExceptionBean
有什么想法吗?
不同的是,JDK 1.6类的MyExceptionBean生成如下
public class MyExceptionBean {
private String message;
但是使用JDK 1.7
public class MyExceptionBean {
private String message;
private Throwable[] suppressed;
jaxws-maven插件
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.10</version>