Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 85225 invoked from network); 10 Jun 2008 04:41:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Jun 2008 04:41:21 -0000 Received: (qmail 51762 invoked by uid 500); 10 Jun 2008 04:41:23 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 51733 invoked by uid 500); 10 Jun 2008 04:41:23 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 51722 invoked by uid 99); 10 Jun 2008 04:41:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jun 2008 21:41:23 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jun 2008 04:40:42 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4879C234C130 for ; Mon, 9 Jun 2008 21:41:00 -0700 (PDT) Message-ID: <1532506096.1213072860281.JavaMail.jira@brutus> Date: Mon, 9 Jun 2008 21:41:00 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-494) CamelBeanPostProcessor.camelContext cannot be injected if SpringCamelContext is proxied (e.g. AOP) In-Reply-To: <1089311900.1209996463501.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ 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 , which causes all Spring beans to be proxied. This triggers the problem shown above. The problem should be reproducible by adding to any Spring config that uses . > 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.