I have an Local Ejb class that implements the following interface :
public interface LocalEjbService {
public String saveOrders(String request);
public SaveOrdersResponse saveOrders(Integer request);
}
when I call public String saveOrders(String request) method every thing goes fine. and response is returned with no exceptions, but when i tried to call the second method, the call is goes fine but when the method is returned EjbResponse an exception is back to ejb client as the following
java.lang.ClassCastException: com.thegroup.common.beans.ejb.response.oms.SaveOrdersResponse cannot be cast to com.thegroup.common.beans.ejb.response.oms.SaveOrdersResponse
This can happen if the SaveOrdersResponse is loaded by two different classloaders. Once by the client making the call, and once by the implementation returning the response. I would make sure that the jar that contains the transfer objects and EJB interfaces is accessible to both libs. Don't put it in there twice. For instance, in the lib folder of the EAR is a great place for shared libs like this.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments