【发布时间】:2010-11-09 16:51:43
【问题描述】:
我们有下面的 JAXB/Java 代码。在我们将 List<JQGridTO> rows 更改为 List<? extends JQGridTO> rows 之前,这一直很好。
当我们做出改变时,我们得到了这个错误:
构造函数抛出异常;嵌套的 com.sun 是个例外。 xml.bind.v2.runtime.IllegalAnnotationsException:1 个计数 IllegalAnnotationExceptions 属性 行出现在@XmlType.propOrder 中, 但不存在这样的财产。可能是你 意味着记录? 此问题与以下位置有关: 在 com.me.ui.service.JQGridJsonRoot
为什么会出现此错误?你不能像我们一样使用泛型(即:指定? extends XXX)吗?
@XmlRootElement
@XmlType(name = "", propOrder = {
"records",
"page",
"total",
"rows"
})
public class JQGridJsonRoot {
int total; //total pages for the query
int page; //current page of the query
int records; //total number of records for the query
List<? extends JQGridTO> rows
...
【问题讨论】: