2012-04-17 11 views
2

を返しません。私は最近、これの要旨はどのように複製しない、ミュール3は、スタックトレースを返しませんが、ミュール2がないですミュール3.xのミュール3 WebServiceがスタックトレース

にミュール2.2.1から切り替えましたミュール2の行動?

詳細:Webサービスのいくつかは、我々はは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 

に投げるのtry-catchでラップされ

LoggingDaoがスタックトレースを記録するが、Webサービスはそれを返しません。どこかでスタックトレースをオーバーライドし、ミュール3.xの

P.S.にスタックトレースを返すについては、私は行くだろうどのように

<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> 

返しMuleExceptionをスロー我々は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に

は交換のパターンは、「要求 - 応答」ではないことに関しては異なっている

答えて

2

私は、これはミュール3での既知の問題であると言われてきました。 X < 3.2 溶液を
トーマスBLOHM

public class CustomSoapFaultOutInterceptor extends AbstractSoapInterceptor { 
    private static final Log logger = LogFactory.getLog(CustomSoapFaultOutInterceptor.class); 

public CustomSoapFaultOutInterceptor() { 
     super(Phase.MARSHAL); 
     getAfter().add(Soap11FaultOutInterceptor.class.getName()); 
    } 
    @Override 
    public void handleMessage(SoapMessage message) throws Fault { 
     Fault fault = (Fault) message.getContent(Exception.class); 
     logger.error(fault.getMessage(), fault); 
    //delete the Mule Exception to have the one throw by the component in the SoapMessage 
     Throwable t = getOriginalCause(fault.getCause()); 
     fault.setMessage(t.getMessage()); 
    } 
    private Throwable getOriginalCause(Throwable t) { 
     if (t.getCause() == null || t.getCause().equals(t)) 
      return t; 
     else 
      return getOriginalCause(t.getCause()); 
    } 
} 

//And then this into mule-config. 
<cxf:jaxws-service> 
    <cxf:outFaultInterceptors> 
     <spring:bean class="is.tr.mule.interceptor.CustomSoapFaultOutInterceptor"/> 
    </cxf:outFaultInterceptors> 
</cxf:jaxws-service> 
によってOutFaultインターセプタ コードを記述することです