我最近從騾2.2.1切換到騾子3.X騾子3 web服務不會返回堆棧跟蹤
這樣做的主旨是騾子3不返回堆棧跟蹤,但騾子2呢,我怎麼複製騾2的行爲?
更多細節:
一些Web服務被包裹在一個try-catch,我們拋出ServiceException
@WebFault(name = "ServiceException")
public class ServiceException extends Exception {
private static final long serialVersionUID = 1L;
private Integer errorNumber;
public ServiceException(Exception e, User user) {
super(makeMessage(e));
LoggingDao.logException(this.getMessage(), e.toString());
this.setStackTrace(e.getStackTrace());
this.errorNumber = LoggingDao.getLogId();
} ... etc
當我們捕捉到了異常與堆棧跟蹤返回給Web的目標服務調用者,通過LoggingDao記錄堆棧跟蹤的方式,但Web服務不會返回它。
沿拋出一個MuleException將覆蓋堆棧跟蹤並返回
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Component that caused exception is: org.mule.component.DefaultJavaComponent component for: SedaService{...}. Message payload is of type: Object[]</faultstring>
</soap:Fault>
我將如何去在騾子3.X
附註:返回堆棧跟蹤我們跳進DefaultComponentLifecycleAdapter.java路上某處 我使用的是Mule 3.0.1,它似乎與我上面提供的鏈接不兼容。
也從:http://www.mulesoft.org/documentation/display/MULE3USER/Error+Handling
如果流動交換模式是請求 - 響應,不同的消息被返回到已經被執行之後調用者。該消息具有org.mule.transport.NullPayload作爲其有效內容,並且exceptionPayload屬性設置爲以下內容:org.mule.api.ExceptionPayload。 < 前面提到的是什麼給我帶來麻煩?
從騾子2騾子-config.xml文件是在問候的交換模式不是「請求 - 響應」