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

View: New views
7 Messages — Rating Filter:   Alert me  

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

by Eliott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

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

by dhenton9000 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

by Eliott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

no, i think its an other issue. my problem is not the invocation of the given service, but the lack of transformation on the service that executes.



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

by antoine.borg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@... | blog: blog.ricston.com | web: ricston.com

-----Original Message-----
From: Eliott [mailto:eliott100@...]
Sent: Wednesday, August 27, 2008 10:24 PM
To: user@...
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



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

by Eliott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


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

by Eliott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, my bad. In the transformer I was expecting Exception.class instead of ExceptionMessage.class


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



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

by antoine.borg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I suspect that your transformer ignores any exceptions unless they are of
type "Exception", i.e., it seems to ignore any descendent classes. This is
an odd thought as this behaviour should happen if the ignoreBadInput
attribute is set to "true" (at least that's my understanding)
This can be confirmed by using the AutoTransformer:
http://mule.mulesource.org/display/MULE2USER/Transformers+Configuration+Refe
rence#TransformersConfigurationReference-Autotransformer since your
transformer will be used if it can handle the exception that is being
raised.

Another simple test would be to remove the registerSourceType() method call
from the constructor and see what happens.

Cheers


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

-----Original Message-----
From: Eliott [mailto:eliott100@...]
Sent: Monday, September 01, 2008 9:05 PM
To: user@...
Subject: RE: [mule-user] default-service-exception-strategy transformer
question, possible bug


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.F
ileContentsMessageAdapter@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@... | blog: blog.ricston.com | web:
> ricston.com
>
> -----Original Message-----
> From: Eliott [mailto:eliott100@...]
> Sent: Wednesday, August 27, 2008 10:24 PM
> To: user@...
> 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-q
> uestio 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
>
>
>
>

--
View this message in context:
http://www.nabble.com/default-service-exception-strategy-transformer-questio
n%2C-possible-bug-tp19188991p19259258.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