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

Problem with passing my own exceptions from EJB webservices

14 Views

Hello SDN!

Here is a code:

	try{
		wdContext.currentMnRemoveTypeElement().setTypeId(typeId);
		wdContext.currentMnReqRemoveTypeElement().modelObject().execute();
		wdContext.currentMnRemoveTypeErrorPartElement();
		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