Invalid "required" attribute

0

I took a project and it is showing compilation error because it is not recognizing the "required" attribute in the following section:

@XmlElementRef(name = "Nome", namespace = "http://schemas.datacontract.org/teste/teste/teste", type = JAXBElement.class, required = false)

The displayed error is:

  

The required attribute is undefined for the annotation type   XmlElementRef

    
asked by anonymous 21.02.2017 / 15:00

1 answer

0

The problem occurs because you are using Java 6. The required only started to be supported from Java 7, according to documentation . So to work, you'll need to use Java 7 at a minimum.

Source: link

    
21.02.2017 / 15:18