« Return to Thread: default-service-exception-strategy transformer question, possible bug

RE: default-service-exception-strategy transformer question, possible bug

by Eliott :: Rate this Message:

Reply to Author | View in Thread

Hi!

thanks for trying to help.

1.)
<custom-transformer name="ExceptionToString" class="com.esys.mule.errorhandler.ExceptionToString"/>

the source is as follows:

package com.esys.mule.errorhandler;

import org.mule.api.transformer.TransformerException;
import org.mule.transformer.AbstractTransformer;

public class ExceptionToString extends AbstractTransformer
{

    public ExceptionToString()
    {
        super();
        this.registerSourceType(Exception.class);
        this.setReturnClass(String.class);
    }

    public Object doTransform(Object src, String encoding) throws TransformerException
    {
    System.out.println(this.getClass().getName() +"this runs");
    return " This does not execute........";
    }

   
   
}

2.)
Here are the few lines after I trigger en exception, that i get at the end is a binary serialized object, probably DefaultExceptionPayload, and not a string.  It does not matter what kind of an object I set at the doTransform method, if I am doing something there, it should throw an other exception.

ERROR 2008-09-01 20:58:29,114 [Point1.2] org.mule.service.DefaultServiceExceptionStrategy: Message being processed is: org.mule.transport.file.FileContentsMessageAdapter/org.mule.transport.file.FileContentsMessageAdapter@104e28b{id=C:\infile\testpo_err2.xml, payload=[B, correlationId=null, correlationGroup=-1, correlationSeq=-1, encoding=UTF-8, exceptionPayload=org.mule.message.DefaultExceptionPayload@1b54362}
INFO  2008-09-01 20:58:29,146 [Point1.2] org.mule.transport.vm.VMMessageDispatcher: Connected: VMMessageDispatcher{this=d12eea, endpoint=vm://systemErrorHandler, disposed=false}
INFO  2008-09-01 20:58:29,162 [Point1.2] org.mule.transport.file.FileMessageDispatcher: Connected: FileMessageDispatcher{this=c0a9f9, endpoint=file://C:/out/err, disposed=false}
INFO  2008-09-01 20:58:29,162 [Point1.2] org.mule.transport.file.FileConnector: Writing file to: C:\out\err\testpo_err2.xml
WARN  2008-09-01 20:58:29,271 [Point1.2] org.mule.config.ExceptionHelper: Failed to load error mappings from: META-INF/services/org/mule/config/vm-exception-mappings.properties This may be because there are no error code mappings for protocol: vm





antoine.borg wrote:
Hello,

The config seems fine.  Can you post the following:

1) The declaration of the ExceptionToString transformer. If this is a custom
transformer, can you post the code for it too?
2) The Mule logs, ideally with debug enabled, showing a message passing
through service "Point1", the exception caused and the message passing
through "SystemErrorHandler".

Antoine  


Antoine Borg, Senior Consultant | Tel: +32 28 504 696
ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM
email: antoine.borg@ricston.com | blog: blog.ricston.com | web: ricston.com

-----Original Message-----
From: Eliott [mailto:eliott100@gmail.com]
Sent: Wednesday, August 27, 2008 10:24 PM
To: user@mule.codehaus.org
Subject: [mule-user] default-service-exception-strategy transformer
question, possible bug


hi!

i am just beginning to experiment with mule, but already managed to find
something that I can not explain based on the documentation.

It seems to me that whenever I route an exception to the SystemErrorHandler
service, the specified transformer is never executed, I have to do the
transformation in the component class.

what am I missing here?

the essence of the config is as follows:
----
   <service name="Point1">
           
       
            <inbound>
        <file:inbound-endpoint ....cut..... transformer-refs="XmlToDom" >
                <file:filename-wildcard-filter pattern="*.txt,*.xml"/>
        </file:inbound-endpoint>
 
       
            </inbound>
           
            <component class="TesterComponent"/>

            <outbound>
                         <outbound-pass-through-router>

                       
                                <file:outbound-endpoint path="dir2"  />

                         </outbound-pass-through-router>
       
            </outbound>

                         
            <default-service-exception-strategy>
                <vm:outbound-endpoint path="systemErrorHandler"/>
            </default-service-exception-strategy>
                       
                       
        </service>


                <service name="SystemErrorHandler">
            <inbound>
                <vm:inbound-endpoint path="systemErrorHandler"
transformer-refs="ExceptionToString" />
            </inbound>
             
                         <component class="ErrorTransfomerWorkaround"/ >
                         
            <outbound>
                <outbound-pass-through-router>
                    <file:outbound-endpoint path="doneerr"  />
                </outbound-pass-through-router>
            </outbound>
        </service>
-----

regards
eliott

--
View this message in context:
http://www.nabble.com/default-service-exception-strategy-transformer-questio
n%2C-possible-bug-tp19188991p19188991.html
Sent from the Mule - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

 « Return to Thread: default-service-exception-strategy transformer question, possible bug