Author: boisvert Date: Wed Jan 24 15:11:03 2007 New Revision: 499607 URL: http://svn.apache.org/viewvc?view=rev&rev=499607 Log: Better error reporting on this remote interface; local exceptions are logged and remote exceptions contain only informative text and not a whole hierarchy of nested exception (which otherwise often lead to ClassCastExceptions, ClassNotFoundExceptions, NotSerializableException and I probably forget some)
Modified: incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java Modified: incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java?view=diff&rev=499607&r1=499606&r2=499607 ============================================================================== --- incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java (original) +++ incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java Wed Jan 24 15:11:03 2007 @@ -90,7 +90,8 @@ for (ProcessConf pconf : processQuery(processFilter)) fillProcessInfo(procInfoList.addNewProcessInfo(), pconf, custom); } catch (Exception e) { - throw new ProcessingException("Exception while listing processes", e); + __log.error("Exception while listing processes", e); + throw new ProcessingException("Exception while listing processes: " + e.toString()); } return ret; @@ -116,7 +117,8 @@ try { _store.setState(pid, org.apache.ode.bpel.iapi.ProcessState.ACTIVE); } catch (Exception ex) { - throw new ManagementException("Error setting process state.", ex); + __log.error("Exception while setting process state", ex); + throw new ManagementException("Error setting process state: " + ex.toString()); } return genProcessInfoDocument(pid, ProcessInfoCustomizer.NONE); } @@ -125,6 +127,7 @@ try { _store.setState(pid, retired ? ProcessState.RETIRED : ProcessState.ACTIVE); } catch (BpelEngineException e) { + __log.error("Exception while setting process as retired", e); throw new ProcessNotFoundException("ProcessNotFound:" + pid); } return genProcessInfoDocument(pid, ProcessInfoCustomizer.NONE); @@ -139,7 +142,7 @@ _store.setProperty(pid, propertyName, value); } catch (Exception ex) { // Likely the process no longer exists in the store. - __log.debug("Error setting property value for " + pid + "; " + propertyName); + __log.debug("Error setting property value for " + pid + "; " + propertyName, ex); } // We have to do this after we set the property, since the @@ -154,7 +157,8 @@ } catch (ManagementException me) { throw me; } catch (Exception e) { - throw new ProcessingException("Exception while setting process property", e); + __log.error("Exception while setting process property", e); + throw new ProcessingException("Exception while setting process property: " + e.toString()); } return ret; @@ -169,7 +173,7 @@ _store.setProperty(pid, propertyName, value); } catch (Exception ex) { // Likely the process no longer exists in the store. - __log.debug("Error setting property value for " + pid + "; " + propertyName); + __log.debug("Error setting property value for " + pid + "; " + propertyName, ex); } // We have to do this after we set the property, since the @@ -184,7 +188,8 @@ } catch (ManagementException me) { throw me; } catch (Exception e) { - throw new ProcessingException("Exception while setting process property", e); + __log.error("Exception while setting process property", e); + throw new ProcessingException("Exception while setting process property" + e.toString()); } return ret; @@ -206,9 +211,9 @@ } }); } catch (Exception e) { - throw new ProcessingException("Exception while listing instances", e); + __log.error("Exception while listing instances", e); + throw new ProcessingException("Exception while listing instances: " + e.toString()); } - return ret; } @@ -317,7 +322,8 @@ } }); } catch (Exception e) { - throw new ProcessingException("Exception during activity recovery", e); + __log.error("Exception during activity recovery", e); + throw new ProcessingException("Exception during activity recovery" + e.toString()); } return genInstanceInfoDocument(iid); } @@ -338,7 +344,8 @@ } }); } catch (Exception e) { - throw new ProcessingException("Exception during instance deletion", e); + __log.error("Exception during instance deletion", e); + throw new ProcessingException("Exception during instance deletion: " + e.toString()); } return ret; @@ -451,7 +458,8 @@ } }); } catch (Exception e) { - throw new ProcessingException("Exception during instance retrieval", e); + __log.error("Exception during instance retrieval", e); + throw new ProcessingException("Exception during instance retrieval: " + e.toString()); } return getDebugger(processId); @@ -472,7 +480,8 @@ } catch (ManagementException me) { throw me; } catch (Exception e) { - throw new ManagementException("Exception during database operation", e); + __log.error("Exception during database operation", e); + throw new ManagementException("Exception during database operation: " + e.toString()); } } @@ -492,7 +501,8 @@ // Passthrough. throw me; } catch (Exception ex) { - throw new ManagementException("Exception during database operation", ex); + __log.error("Exception during database operation", ex); + throw new ManagementException("Exception during database operation" + ex.toString()); } } @@ -508,7 +518,8 @@ } catch (ManagementException me) { throw me; } catch (Exception e) { - throw new ProcessingException("Exception while retrieving process information", e); + __log.error("Exception while retrieving process information", e); + throw new ProcessingException("Exception while retrieving process information: " + e.toString()); } return ret; @@ -1009,7 +1020,8 @@ } }); } catch (Exception e) { - throw new ProcessingException("Exception while querying instances", e); + __log.error("Exception while querying instances", e); + throw new ProcessingException("Exception while querying instances: " + e.toString()); } return ret; @@ -1070,7 +1082,8 @@ dd = ISO8601DateParser.parse(Filter.getDateWithoutOp(ddf)); } catch (ParseException e) { // Should never happen. - throw new RuntimeException(e); + __log.error("Exception while parsing date", e); + throw new RuntimeException(e.toString()); } CollectionsX.remove_if(confs, new MemberOfFunction<ProcessConf>() {