2011-11-14 60 views
0

这里是我用来公开为Web服务代码问题同时暴露方法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

更改类型从ListArrayList,这是List的具体实现。