camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mick Knutson <mknut...@baselogic.com>
Subject test client context issues with test routes and service beans
Date Fri, 28 Aug 2009 18:05:48 GMT
Before the 2.0.0 upgrade, I had my client camel context starting my test
RouteBuilder, and other Beans, but now they are not initializing.

Here is my clientContext I tried with creating a <bean> for the routeBuilder
Ref:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="
http://www.springframework.org/schema/context"
    xmlns:camel="http://camel.apache.org/schema/spring"
    xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd
       ">

    <context:component-scan base-package="com.wiredducks.test">
        <context:include-filter type="aspectj"
            expression="com.wiredducks.test.*.*" />
    </context:component-scan>

    <!-- Create a client Camel Context -->
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">

        <packageScan>
            <package>com.wiredducks.test</package>
            <excludes>**.*Excluded*</excludes>
            <includes>**.*</includes>
        </packageScan>

        <!-- Create a Consumer so we can consume messages -->
        <consumerTemplate id="consumer" />
        <routeBuilder ref="clientRoutes" />
    </camelContext>

    <bean id="clientRoutes" class="com.wiredducks.test.routes.ClientRoutes"
/>


Here shows the clientRoutes:


[                          main] DefaultListableBeanFactory     INFO
Overriding bean definition for bean 'clientRoutes': replacing [Generic bean:
class [com.wiredducks.test.routes.ClientRoutes]; scope=singleton;
abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0;
autowireCandidate=true; primary=false; factoryBeanName=null;
factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined
in file
[/Development/Workspaces/freemarketgaming-tc/wiredducks/services/table-service-su/target/test-classes/com/wiredducks/test/routes/ClientRoutes.class]]
with [Generic bean: class [com.wiredducks.test.routes.ClientRoutes];
scope=singleton; abstract=false; lazyInit=false; autowireMode=0;
dependencyCheck=0; autowireCandidate=true; primary=false;
factoryBeanName=null; factoryMethodName=null; initMethodName=null;
destroyMethodName=null; defined in class path resource [camel-client.xml]]


Then I deleted the routeBuilder like:


<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="
http://www.springframework.org/schema/context"
    xmlns:camel="http://camel.apache.org/schema/spring"
    xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
       http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring-2.0.0.xsd
       ">

    <context:component-scan base-package="com.wiredducks.test">
        <context:include-filter type="aspectj"
            expression="com.wiredducks.test.*.*" />
    </context:component-scan>

    <!-- Create a client Camel Context -->
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">

        <packageScan>
            <package>com.wiredducks.test</package>
            <excludes>**.*Excluded*</excludes>
            <includes>**.*</includes>
        </packageScan>

        <!-- Create a Consumer so we can consume messages -->
        <consumerTemplate id="consumer" />
    </camelContext>


Again, I see the bean in the namespace, but I do not see it initializing:


[                          main] DefaultListableBeanFactory     INFO
Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@7e1c7ca6:
defining beans
[clientRoutes,tableServiceTest,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,consumer,camel:beanPostProcessor,camel,jms,connectionFactory,transactionManager,resultClient1Seda,test-client1,destinationResolver,jmsContainer,messageDrivenMockWiretapClient1,org.springframework.aop.config.internalAutoProxyCreator,onMessageCall,org.springframework.aop.aspectj.AspectJPointcutAdvisor#0,multiplierProxy,tableServiceProxy,org.springframework.aop.aspectj.AspectJPointcutAdvisor#1];
root of factory hierarchy



I added this to my route to ensure I could see it initialize:

    @Override
    public void configure() throws Exception {
        log.info("//@@@@@ CLIENT ROUTES
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@//");
        ...

Then I also seem to have the issue that my MessageDrivenPojo is not
initializing as well.

    <bean id="test-client1"
class="com.wiredducks.service.impl.StatusUpdateService"
        scope="prototype">
        <property name="consumerId" value="1" />
        <property name="tableId" value="1" />
    </bean>

It shows the bean in the namespace:

[                          main] DefaultListableBeanFactory     INFO
Overriding bean definition for bean 'test-client1': replacing [Generic bean:
class [com.wiredducks.service.impl.StatusUpdateService]; scope=prototype;
abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0;
autowireCandidate=true; primary=false; factoryBeanName=null;
factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined
in class path resource [clients/test-client1.xml]] with [Generic bean: class
[com.wiredducks.service.impl.StatusUpdateService]; scope=prototype;
abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0;
autowireCandidate=true; primary=false; factoryBeanName=null;
factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined
in class path resource [clients/test-client1.xml]]


I am sorry for all the trouble, but the new schema has thrown me for a loop.




---
Thank You…

Mick Knutson, President

BASE Logic, Inc.
Enterprise Architecture, Design, Mentoring & Agile Consulting
p. (866) BLiNC-411: (254-6241-1)
f. (415) 685-4233

Website: http://baselogic.com
Linked IN: http://linkedin.com/in/mickknutson
Vacation Rental: http://tahoe.baselogic.com
---

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message