I am facing below mentioned error when calling the GWT rpc method to retrieve some data. Every thing is working pretty fine on Windows but rpc calls are throwing this exception on ubuntu. Application is deployed on Tomcat. I have see tried all work arounds for serialization but nothing works.. Please help !!!
SEVERE: Exception while dispatching incoming RPC call com.google.gwt.user.client.rpc.SerializationException: Type 'javax.persistence.NoResultException' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = javax.persistence.NoResultException: No entity found for queryat com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:667)
The code snippet from my SettingsDAO.java
public SettingsDTO findSettingsByName(String name) {
TypedQuery<SettingsDTO> query = getEntityManager().createQuery("SELECT u FROM SettingsDTO u WHERE u.name = :name", SettingsDTO.class);
return query.setParameter("name", name).getSingleResult();
}
code snippet from GWT Service Implementaion.
@Transactional(readOnly=true)
public Integer getRemainingAttempts(String username) {
SettingsDTO settings = settingsDAO.findSettingsByName("STD");
int maxLogin = settings.getNloginAttempts();
UserDTO user = userDAO.findUserByName(username);
int locked = user.getLocked();
if (locked == -1) {
return locked;
} else if (locked >= maxLogin) {
return 0;
} else {
return (maxLogin-locked);
}
}