2010-11-09 16 views
6

Abbiamo il codice JAXB/Java sotto. Questo ha funzionato bene fino a quando abbiamo cambiato List<JQGridTO> rows-List<? extends JQGridTO> rows.JAXB e Raccolte contenenti farmaci generici

Quando abbiamo fatto che il cambiamento si ottiene questo errore:

Constructor threw exception; nested exception is com.sun. xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions Property rows appears in @XmlType.propOrder, but no such property exists. Maybe you meant records? this problem is related to the following location: at com.me.ui.service.JQGridJsonRoot

Perché otteniamo questo errore? Non puoi usare Generics come abbiamo fatto (vale a dire: specificando ? 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 
    ... 

risposta

Problemi correlati