Hi, I am trying to unmarshall a XML document created from jersey JAXB annotated class.
JAXBContext jaxbCtx = JAXBContext.newInstance(MyClass.class);
Unmarshaller m = jaxbCtx.createUnmarshaller();
MyClass result = (MyClass) m.unmarshal(in)
MyClass looks something like:
@XmlRootElement(name = "my-class")
@XmlSeeAlso(SomeOther.class)
public class MyClass {
private Collection<SomeOther> result;
private URI uri;
private String errorMsg;
@XmlElement
public String getError() {
return errorMsg;
}
@XmlElement
public Collection<SomeOther> getResult() {
return // some Set<SomeOther>;
}
@XmlAttribute
public URI getUri() {
return uri;
}
The sample XML is as below:
<my-class uri="some uri">
<error></error>
<result>
<some other information in tags>
</result>
...
<result>
</result>
</my-class>
The object returned by jaxb unmarshaler contains all values as null; Could somebody help here? Thanks Nayn