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-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
Date Tue, 18 May 2010 04:40:13 GMT

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

Claus Ibsen commented on CAMEL-2730:
------------------------------------

You get a ResolveEndpointFailedException exception because the endpoint uri is invalid. See
in the stacktrace
{code}
Caused by: java.net.URISyntaxException: Illegal character in scheme name at index 3: Mon%20May%2017%2017:30:04%202010
blah
{code}

So its most likely that the fakeOutputChooser returns something unexpected. Looks like a date
instead of an endpoint uri.
{code}
.recipientList().method("fakeOutputChooser", "chooseErrorLog");
{code}


> 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] - <Message
exchange has failed so breaking out of pipeline: Exchange[Message: 
> 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.


Mime
View raw message