源:http://www.233.com/ncre2/JAVA/jichu/20100823/082002104-3.html
评:
1.异常 Exception in thread "main" com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException:
2 counts of IllegalAnnotationExceptions
解决: @XmlTransient
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
[b]注意要把@XmlTransient放在get()方法前面,否则可能会出现导致运行报错:[/b]
评:
1.异常 Exception in thread "main" com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException:
2 counts of IllegalAnnotationExceptions
解决: @XmlTransient
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
[b]注意要把@XmlTransient放在get()方法前面,否则可能会出现导致运行报错:[/b]

本文解决了一个在Java编程中遇到的异常问题,即`IllegalAnnotationsException`,详细介绍了异常产生的原因以及如何通过将`@XmlTransient`注解放在特定方法前避免该错误。同时提供了代码示例来帮助开发者理解和应用解决方案。
1180

被折叠的 条评论
为什么被折叠?



