[
https://issues.apache.org/jira/browse/CAMEL-4760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13167386#comment-13167386
]
Sergey Zhemzhitsky edited comment on CAMEL-4760 at 12/12/11 7:12 AM:
---------------------------------------------------------------------
Hello Claus,
Thanks a lot for clarification, but I'm still wondering how to use
_onException_ and custom executor service at the same time.
What I need is async. redelivery + logging every redelivery attempt using
custom logName and logLevel.
I have tried to use DefaultErrorHandler, but Spring DSL does not allow to
specify custom logName, although Java DSL does.
Here is an exception:
{code}
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid
property 'logName' of bean class
[org.apache.camel.builder.DefaultErrorHandlerBuilder]: Bean property 'logName'
is not writable or has an invalid setter method. Does the parameter type of the
setter match the return type of the getter?
at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1024)
at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:900)
at
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
at
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowire
{code}
was (Author: szhemzhitsky):
Hello Clause,
Thanks a lot for clarification, but I'm still wondering how to use
_onException_ and custom executor service at the same time.
What I need is async. redelivery + logging every redelivery attempt using
custom logName and logLevel.
I have tried to use DefaultErrorHandler, but Spring DSL does not allow to
specify custom logName, although Java DSL does.
Here is an exception:
{code}
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid
property 'logName' of bean class
[org.apache.camel.builder.DefaultErrorHandlerBuilder]: Bean property 'logName'
is not writable or has an invalid setter method. Does the parameter type of the
setter match the return type of the getter?
at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1024)
at
org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:900)
at
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
at
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowire
{code}
> Unable to set logName on DefaultErrorHandler as well as executorService on
> LoggingErrorHandler
> ----------------------------------------------------------------------------------------------
>
> Key: CAMEL-4760
> URL: https://issues.apache.org/jira/browse/CAMEL-4760
> Project: Camel
> Issue Type: Improvement
> Components: camel-spring
> Affects Versions: 2.8.3
> Reporter: Sergey Zhemzhitsky
> Assignee: Claus Ibsen
> Priority: Minor
> Fix For: 2.8.4, 2.9.0
>
>
> The following snippets do not work, although each of the specified error
> handlers supports _logName_ and _executorServiceRef_. The issue is actual for
> the _DeadLetterChannel_ error handler too.
> {code:title=LoggingErrorHandler}
> <errorHandler id="errorHandler" type="LoggingErrorHandler"
> logName="${router.logger.name}" executorServiceRef="redeliveryExecutor"/>
> {code}
> {code:title=DefaultErrorHandler}
> <errorHandler id="errorHandler" type="DefaultErrorHandler"
> logName="${router.logger.name}" executorServiceRef="redeliveryExecutor"/>
> {code}
> {code:title=StackTrace}
> Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
> Unexpected exception parsing XML document from class path resource
> [META-INF/spring/camel-context.xml]; nested exception is
> java.lang.IllegalArgumentException: Attribute executorServiceRef is not
> supported by error handler type: LoggingErrorHandler, in error handler with
> id: errorHandler
> at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
> at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
> at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
> at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
> at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
> at
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:186)
> ... 42 more
> Caused by: java.lang.IllegalArgumentException: Attribute executorServiceRef
> is not supported by error handler type: LoggingErrorHandler, in error handler
> with id: errorHandler
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira