camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-494) CamelBeanPostProcessor.camelContext cannot be injected if SpringCamelContext is proxied (e.g. AOP)
Date Tue, 10 Jun 2008 04:41:00 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43361#action_43361
] 

Claus Ibsen commented on CAMEL-494:
-----------------------------------

I tried the example-spring-jms with Camel 1.3.0 and it also works out-of-the-box
{code}
D:\project\camel\examples\camel-example-spring-jms>mvn clean compile exec:java -PCamelServer494
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Camel :: Example :: Spring :: JMS
[INFO]    task-segment: [clean, compile, exec:java]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory D:\project\camel\examples\camel-example-spring-jms\target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 6 source files to D:\project\camel\examples\camel-example-spring-jms\target\classes
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java]
[pache.camel.spring.Main.main()] Main                           INFO  Apache Camel 1.3.0 starting
[pache.camel.spring.Main.main()] ClassPathXmlApplicationContext INFO  Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@19fe451:
display name [org.springframework.context.support.ClassPathXmlApplicationContext@19fe451];
startup date [Tue Jun 10 06:38:16 CEST 2008]; root o
f context hierarchy
[pache.camel.spring.Main.main()] XmlBeanDefinitionReader        INFO  Loading XML bean definitions
from class path resource [META-INF/spring/camel-494.xml]
[pache.camel.spring.Main.main()] ClassPathXmlApplicationContext INFO  Bean factory for application
context [org.springframework.context.support.ClassPathXmlApplicationContext@19fe451]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1757337
[pache.camel.spring.Main.main()] ClassPathXmlApplicationContext INFO  Bean 'org.apache.camel.example.server.ServerRoutes'
is not eligible for getting processed by all BeanPostProcessors (for example: not eligible
for auto-proxying)
[pache.camel.spring.Main.main()] ClassPathXmlApplicationContext INFO  Bean 'Claus' is not
eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[pache.camel.spring.Main.main()] ClassPathXmlApplicationContext INFO  Bean 'Claus' is not
eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[pache.camel.spring.Main.main()] DefaultListableBeanFactory     INFO  Pre-instantiating singletons
in org.springframework.beans.factory.support.DefaultListableBeanFactory@1757337: defining
beans [multiplier,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframewor
k.context.annotation.internalAutowiredAnnotationProcessor,Claus:beanPostProcessor,Claus,AuditTracker,AuditStore,jms,org.apache.activemq.xbean.XBeanBrokerService#0,org.springframework.aop.config.internalAutoProxyCreator];
root of factory hierarchy
[pache.camel.spring.Main.main()] BrokerService                  INFO  Using Persistence Adapter:
MemoryPersistenceAdapter
[pache.camel.spring.Main.main()] BrokerService                  INFO  ActiveMQ 5.1.0 JMS Message
Broker (localhost) is starting
[pache.camel.spring.Main.main()] BrokerService                  INFO  For help or more information
please see: http://activemq.apache.org/
[pache.camel.spring.Main.main()] TransportServerThreadSupport   INFO  Listening for connections
at: tcp://claus-acer:61616
[pache.camel.spring.Main.main()] TransportConnector             INFO  Connector tcp Started
[pache.camel.spring.Main.main()] BrokerService                  INFO  ActiveMQ JMS Message
Broker (localhost, ID:claus-acer-2460-1213072701953-0:0) started
[pache.camel.spring.Main.main()] TransportConnector             INFO  Connector vm://localhost
Started
{code}

> CamelBeanPostProcessor.camelContext cannot be injected if SpringCamelContext is proxied
(e.g. AOP)
> --------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-494
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-494
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-spring
>    Affects Versions: 1.3.0
>            Reporter: Dean Thompson
>            Assignee: Claus Ibsen
>             Fix For: 1.4.0
>
>         Attachments: iris-framework.xml
>
>
> Because CamelBeanPostProcessor.setCamelContext(SpringCamelContext) takes the class SpringCamelContext
as its parameter, bean initialization fails if SpringCamelContext is proxied.  The error is
as follows:
> {code}
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'camelContext:beanPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException:
Failed to convert property value of type [$Proxy61] to required type [org.apache.camel.spring.SpringCamelContext]
for property 'camelContext'; nested exception is java.lang.IllegalArgumentException: Cannot
convert value of type [$Proxy61] to required type [org.apache.camel.spring.SpringCamelContext]
for property 'camelContext': no matching editors or conversion strategy found
> {code}
> In my project's Spring conf, we declare <aop:aspectj-autoproxy/>, which causes
all Spring beans to be proxied.  This triggers the problem shown above.  The problem should
be reproducible by adding <aop:aspectj-autoproxy/> to any Spring config that uses <camel:camelContext>.
> The fix will be to separate the interface and class for SpringCamelContext, and use the
interface where appropriate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message