我有一个抽象类:
@MappedSuperclass
public abstract class BaseEntity<K>
{
@Temporal(value = TemporalType.TIMESTAMP)
private Date cadastrado;
@Temporal(value = TemporalType.TIMESTAMP)
private Date modificado;
@Column(length = 30)
private String ip;
private String autorModificacao;
public abstract K getId();
public abstract void setId(K id);
...
and a derived class:
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Pessoa extends BaseEntity<Integer> implements Serializable {
@Id
@ColumnGridPF
@GeneratedValue(strategy = GenerationType.AUTO, generator = "pessoa")
private Integer id;
....
@Override
Integer getId() {
return id;
}
@Override
public void setId(Integer id) {
this.id = id;
}
....
when my application try to unmarshall the object, I get an error
**
SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.ElementNSImpl cannot be cast to java.lang.Integer
at br.com.sigmaonline.entity.cadastro.pessoa.Pessoa.setId(Pessoa.java:46)
at br.com.sigmaonline.entity.common.generic.BaseEntity$JaxbAccessorM_getId_setId_java_lang_Object.set(MethodAccessor_Ref.java:60)
**
谁能帮我?