Skip to Content
Dec 29, 2007 at 09:54 AM

Problem with passing my own exceptions from EJB webservices


Hello SDN!

Here is a code:

		msgMgr.reportSuccess("Information deleted.");
	}catch(Exception ex){
		// print error message

If I import web service as Web Service Model (DEPRECATED), model method execute() throws exception with type Exception, but if I'm using a Adaptive Web Service model, method execute() throws exception with type CMIException. This method connected with EJB method which throws DRException (it's my own type of exceptions extends Exception).

When I call this code an exception is occured, but type of ex is ClassCastException and error message is empty whereas I expect a DRException with my error message. I think that reason is failed to cast DRException toCMIException...

So how I can pass my own exception from EJB webservice to Adaptive Web Service model?

regards, Lev