2014-05-15 9 views
0

글로벌 예외 전략을 정의했지만 Mule이 Groovy 스크립트를 실행할 때 글로벌 캐치 예외 전략을 실행하지 않고 org.mule.exception.DefaultSystemExceptionStrategy를 실행합니다.글로벌 캐치 예외 전략이 사용되지 않았습니다.

<!-- Define Global Catch Exception Strategy --> 
<catch-exception-strategy name="catchExceptionStrategy"> 
    <logger level="ERROR" message="Component X: #[exception]" doc:name="Logger"/> 
    <logger level="ERROR" message="Component X: E1_Error Service exited with errors. Please see the error log for details." doc:name="Logger"/> 
</catch-exception-strategy> 

Mule이 흐름에 정의 된 catch 예외 전략 대신 기본 시스템 예외 전략으로 되돌아가는 이유가 있습니까?

로그 아래에 제공 :

DEBUG 2014-05-15 10:48:46,966 [[processes].returnInputFileConnector.receiver.01] org.mule.api.processor.LoggerMessageProcessor: Component X: Renamed Archived file in archive folder 
INFO 2014-05-15 10:48:46,967 [[processes].returnInputFileConnector.receiver.01] org.mule.api.processor.LoggerMessageProcessor: Component X: L3_Done Service completed with no errors. 
DEBUG 2014-05-15 10:49:00,030 [scheduler-processes_Worker-1] org.mule.api.processor.LoggerMessageProcessor: Component X: Begin batch process at 20140515104900 
ERROR 2014-05-15 10:49:00,254 [scheduler-processes_Worker-1] org.mule.exception.DefaultSystemExceptionStrategy: 
******************************************************************************** 
Message    : Failed to invoke ScriptComponent{returnFlow2.component.1473216174}. Component that caused exception is: ScriptComponent{returnFlow2.component.1473216174}. Message payload is of type: AbstractConnector$7 
Code     : MULE_ERROR--2 
-------------------------------------------------------------------------------- 
Exception stack is: 
1. error=13, Permission denied (java.io.IOException) 
    java.lang.UNIXProcess:-2 (null) 
2. Cannot run program "/Users/edwchang/integration/.mule/apps/processes/classes/scripts/script.sh": error=13, Permission denied (java.io.IOException) 
    java.lang.ProcessBuilder:1041 (null) 
3. java.io.IOException: Cannot run program "/Users/edwchang/integration/.mule/apps/processes/classes/scripts/script.sh": error=13, Permission denied (javax.script.ScriptException) 
    org.codehaus.groovy.jsr223.GroovyScriptEngineImpl:323 (http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/script/ScriptException.html) 
4. Failed to invoke ScriptComponent{Flow2.component.1473216174}. Component that caused exception is: ScriptComponent{Flow2.component.1473216174}. Message payload is of type: AbstractConnector$7 (org.mule.component.ComponentException) 
    org.mule.component.AbstractComponent:148 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/component/ComponentException.html) 
-------------------------------------------------------------------------------- 
Root Exception stack trace: 
java.io.IOException: error=13, Permission denied 
    at java.lang.UNIXProcess.forkAndExec(Native Method) 
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:135) 
    at java.lang.ProcessImpl.start(ProcessImpl.java:130) 
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything) 
******************************************************************************** 
+0

스케줄러 프로세스가 다른 catch 예외 전략 구성 요소를 사용하고 명시 적으로이를 구성해야하기 때문입니까? – EdC

+0

시나리오를 더 자세히 이해하려면 흐름 설정을 추가하십시오. – user1760178

답변

1

당신의 예외가 뮬 문서 here에 따라, 시스템 레벨에서 발생되고 있음을 나타납니다 :

뮬은 시스템 예외 전략 경우를 호출 시스템 수준에서 예외가 발생합니다 (즉, 메시지가 관련되지 않은 경우 시스템 예외 전략에 의해 예외가 처리됩니다).

실행하려는 쉘 스크립트에서 예외가 발생 했으므로 Mule 메시지가 포함되어 있지 않기 때문에이 예외 전략이 발생했다고 생각합니다.

1

글로벌 예외 전략을 제공하기 위해 여기에 샘플 코드가 있습니다.

<!-- Define Global Catch Exception Strategy --> 
<catch-exception-strategy name="catchExceptionStrategy"> 
    <logger level="ERROR" message="Component X: #[exception]" doc:name="Logger"/> 
    <logger level="ERROR" message="Component X: E1_Error Service exited with errors. Please see the error log for details." doc:name="Logger"/> 
</catch-exception-strategy> 

<configuration defaultExceptionStrategy-ref="catchExceptionStrategy" /> 

따라서 예외에 메시지 (즉, 흐름)가 포함되면 예외 전략에 의해 처리됩니다. Else Mule의 시스템 예외 전략 (System Exception Strategy)이이를 처리 할 것입니다.