这是我曾经作为webservices公开的代码
rs = st.executeQuery(individualqueries);
columnNames = new ArrayList<String>();
int numCols = rs.getMetaData().getColumnCount();
int j = 0;
for (j = 1; j <= numCols; j++)
{
columnNames.add(rs.getMetaData().getColumnName(j));
}
queryResult.fields.addAll(columnNames);
records = new ArrayList<List<String>>();
while (rs.next()) {
List<String> fieldValues = new ArrayList<String>();
int k = 0;
for (k = 1; k <= numCols; k++) {
fieldValues.add(rs.getString(k));
}
records.add(fieldValues);
}
当我尝试公开此消息时,我收到如下错误消息
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
java.util.List is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at private java.util.List
答案 0 :(得分:0)
将类型从List
更改为ArrayList
,这是List
的具体实现。