I have a strange situation where the getter in the class returns a primitive int type, and setter accepts the Integer class.
When jaxb disconnects an element for this class, it cannot find the required parameter that it is looking for:
public class Foo { int bar; public int getBar() { return this.bar; } public void setBar(Integer bar) { this.bar = bar.intValue(); } }
I tried to add:
@XmlElement ( type = java.lang.Integer.class, name = "bar" )
to the receiver (and setter) to change the type of the field in the circuit, but this does not help.
During unmarshalling, I get this error: the property has getter "public int com.example.getBar ()" but no setter. To disassemble, please define the setters.
I cannot change the class as in, I cannot change bar to Integer or add a new setter with a primitive type, but I can add annotations.
source share