6

We have the JAXB/Java code below. This worked fine until we changed List<JQGridTO> rows to List<? extends JQGridTO> rows.

When we made that change we get this error:

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

Why do we get this error? Can't you use Generics as we did (ie: specifing ? 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
    ...
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429

1 Answers1

4

Take a look at this SO post. I think it has what you need: JAXB Marshalling and Generics

Community
  • 1
  • 1
John Engelman
  • 4,119
  • 1
  • 16
  • 12