Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 14625 invoked from network); 18 May 2010 11:36:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 May 2010 11:36:44 -0000 Received: (qmail 3477 invoked by uid 500); 18 May 2010 11:36:43 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 3350 invoked by uid 500); 18 May 2010 11:36:41 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 3342 invoked by uid 500); 18 May 2010 11:36:41 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 3339 invoked by uid 99); 18 May 2010 11:36:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 May 2010 11:36:40 +0000 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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 May 2010 11:36:38 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4IBaGvh027927 for ; Tue, 18 May 2010 11:36:16 GMT Message-ID: <17121187.511274182576181.JavaMail.jira@thor> Date: Tue, 18 May 2010 07:36:16 -0400 (EDT) From: "Karl Palsson (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-2730) test: Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in In-Reply-To: <8725222.31274117225129.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-2730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=59415#action_59415 ] Karl Palsson commented on CAMEL-2730: ------------------------------------- Further, this is caused by the notes at the bottom of: http://camel.apache.org/recipient-list.html If you use {code} blah().recipientList().method(beanName, methodName);{code} You may NOT use {{@RecipientList}} annotation. So if you want to use the _same_ method in a _different_ route, like: {code}.multicast() .to("bean:beanName?method=methodName", "seda:makeErrorLog"); {code} Then you either need to duplicate the method, or find a new way of following the DSL to do the multicast you expect. Working as designed? sure. Working in a manner that was predictable, no. I don't think I could agree with that. > test: Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in > ---------------------------------------------------------------------------------------------------------------------------------------------- > > Key: CAMEL-2730 > URL: https://issues.apache.org/activemq/browse/CAMEL-2730 > Project: Apache Camel > Issue Type: Bug > Components: camel-core, camel-spring-integration > Affects Versions: 2.2.0 > Reporter: Karl Palsson > > I have the following two routes... > {code} > from("seda:errorQueue") > .multicast() > // unhappy with this, toooo fragile... > .to("bean:fakeOutputChooser?method=chooseError", "seda:makeErrorLog"); > from("seda:makeErrorLog") > .process(new Processor() { > public void process(Exchange exchange) throws Exception { > ErrorFileEntry efr = new ErrorFileEntry("blah"); > exchange.getIn().setBody(efr); > } > }) > .to("velocity:/templates/ErrorLog.vm") > .recipientList().method("fakeOutputChooser", "chooseErrorLog"); > {code} > I'm trying to test that when I send things into {{seda:errorQueue}} that the text is written directly out 2 endpoints, the one chosen by the method "chooseError" on the bean "fakeOutputChooser" and _also_ that the velocity templated error log gets written to the endpoint chosen by "chooseErrorLog" on the same bean. > In the past, I didn't use any of this "outputChoosing" and just straight up to() routes using plain "file:" endpoints, and I tested it by hand. I'm now using the spring test support, to try and automatically test that my output choosing logic is working. (I now have to pick a different file endpoint based on some exchange headers) > I've got the tests all working for most cases, but the following case fails completely.... > {code} > @Test > @DirtiesContext > public void testErrorPath() throws Exception { > String someBody = "this will fail because of 4213 in the body"; > errorOutput.expectedBodiesReceived(someBody); > ErrorFileEntry errorBody = new ErrorFileEntry("Mon Jul 26 14:11:25 2010", "something", "awerawer", "1231"); > errorLog.expectedBodiesReceived(errorBody); > directInput.sendBodyAndHeader("direct:input_365", someBody, Exchange.FILE_NAME, "blah"); > errorOutput.assertIsSatisfied(); > errorLog.assertIsSatisfied(); > } > {code} > the errorOutput check passes, but the errorLog check fails, it never received any messages. This is caused by the following debug from spring.. > {quote} > [org.apache.camel.processor.Pipeline:Camel thread 1: seda://makeErrorLog] - Mon May 17 16:58:16 2010 > blah > Arbitrary Error from Fake conax module,1 > ] Exception: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: chooseErrorLog on fakeOutputChooser due to: org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'fakeOutputChooser': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)> > {quote} > The stack trace is gone by the time it gets logged, but it's thrown at BeanExpression.evaluate() line 74 in the 2.2 release code. (processor.process(newExchange) > I suspect this is because the spring context is torn down, and camel test support is just waiting for things to finish before it can start verifying? If I'm just doing it completely wrong, by all means point me in the right direction :) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.