Hi,
I have an application running on Glassfish 3.1, using EJB 3.1. I use the same entities through all layers, from Presentation to Data Access for persistence using EclipseLink(JPA 2.0).
I have this problem, when the client connect to Glassfish Server through localhost:port my app runs very well, but when the connection is established using a remote server with IP:port, the entities sent from the client arrives to the server with all its attributes in null and, of course, I have NullPointerException, and errors when I try to persist them.
Regards,
Arnel.
Here is one of my entities...
@Entity
@Table(schema = "XXX",name ="ncargo")
@XmlRootElement
@NamedQueries({
@NamedQuery(name = "Ncargo.findAll", query = "SELECT n FROM NcargoP n ORDER BY n.idncargo"),
@NamedQuery(name = "Ncargo.findByIdncargo", query = "SELECT n FROM NcargoP n WHERE n.idncargo = :idncargo"),
@NamedQuery(name = "Ncargo.findByNombre", query = "SELECT n FROM NcargoP n WHERE n.nombre = :nombre")})
public class Ncargo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(nullable = false)
private Integer idncargo;
@Basic(optional = false)
@Column(nullable = false, length = 2147483647)
private String nombre;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "idncargo")
private List<DpersonaP> dpersonaList;
public Ncargo() {
}
public Ncargo(Integer idncargo) {
this.idncargo = idncargo;
}
public Ncargo(Integer idncargo, String nombre) {
this.idncargo = idncargo;
this.nombre = nombre;
}
public Integer getIdncargo() {
return idncargo;
}
public void setIdncargo(Integer idncargo) {
this.idncargo = idncargo;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
@XmlTransient
public List<DpersonaP> getDpersonaList() {
return dpersonaList;
}
public void setDpersonaList(List<DpersonaP> dpersonaList) {
this.dpersonaList = dpersonaList;
}
}
__________________________________________________
"Todos el 12 de Septiembre con una Cinta Amarilla"
FIN A LA INJUSTICIA, LIBERENLOS YA!!
http://www.antiterroristas.cu
http://justiciaparaloscinco.wordpress.com