Hi,

Can you start the camel route within simple main() method ?
I need to tell if you there is something wrong with the ABCAggregationRoute.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Sunday, July 28, 2013 at 1:59 AM, jay wrote:

> Hi - i am using Aggregation Strategy for my requirement - while deploying
> the bundle in Fuse ESB7.1 blueprint is failing with
> org.osgi.service.blueprint.container.ComponentDefinitionException for my
> bundle.
>  
> Error:Caused by: org.apache.camel.RuntimeCamelException:
> java.lang.InstantiationException: com.xx.xx.xx.ABCAggregationRoute
> at org.apache.camel.util.ObjectHelper.newInstance(ObjectHelper.java:1168)
> at
> org.apache.camel.util.ReflectionInjector.newInstance(ReflectionInjector.java:32)
> at
> org.apache.camel.impl.DefaultInjector.newInstance(DefaultInjector.java:45)
> at
> org.apache.camel.blueprint.PackageScanRouteBuilderFinder.instantiateBuilder(PackageScanRouteBuilderFinder.java:110)
> at
> org.apache.camel.blueprint.PackageScanRouteBuilderFinder.appendBuilders(PackageScanRouteBuilderFinder.java:72)
> at
> org.apache.camel.blueprint.CamelContextFactoryBean.findRouteBuildersByPackageScan(CamelContextFactoryBean.java:265)
> at
> org.apache.camel.core.xml.AbstractCamelContextFactoryBean.findRouteBuilders(AbstractCamelContextFactoryBean.java:671)
> at
> org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:275)
>  
>  
>  
> My Code:
> bluprint file-  
> // -----------------//
> <cm:property-placeholder persistent-id="xxxx" update-strategy="reload" >
> <cm:default-properties>
> <cm:property name="ACTIVEMQ_INBOUND"
> value="activemq:incomingFiles"/>
> <cm:property name="ACTIVEMQ_ERROR_OUTBOUND" value="Errored"/>
> <cm:property name="ACTIVEMQ_OUTBOUND"
> value="activemq:processedFiles"/>
> </cm:default-properties>
> </cm:property-placeholder>
>  
> <camelContext id="xxxx" trace="false"
> xmlns="http://camel.apache.org/schema/blueprint";>
> <camel:package>com.xxx.xxx.routes</camel:package>
> </camelContext>
>  
> <bean id="AggregationRoute" class="com.xx.xx.xx.ABCAggregationRoute">
> <constructor-arg value="${ACTIVEMQ_INBOUND}"/>
> <constructor-arg value="${ACTIVEMQ_ERROR_OUTBOUND}"/>
> <constructor-arg value="${ACTIVEMQ_OUTBOUND}"/>
> <property name="xxxProcessor" ref="xxxProcessor"/>
> </bean>
>  
> //-----------------//
>  
>  
> JavaDSL file:
> MainRoute Class (ABCAggregationRoute):  
> from(ACTIVEMQ_INBOUND)
> .aggregate(header("XYZ"), new InnerClassAggregator()) //
> below inner class i am calling here
> .completionTimeout(getAggregationTimeout())
> //.marshal(jaxb)
> .to(ACTIVEMQ_OUTBOUND) ;
>  
>  
> Interclass for the MainRoute (InnerClassAggregator):
> InnerClassAggregator implements AggregationStrategy {
>  
> public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
> ArrayList objList =null;
> Object objNew = (Object)newExchange.getIn().getBody(Object.class);
>  
> if(oldExchange == null){
>  
> objList = new ArrayList();
>  
> objList.add(objNew) ;
>  
> newExchange.getIn().setBody(objList);
>  
> return newExchange;
> }
>  
> else{
> objList=oldExchange.getIn().getBody(ArrayList.class);
> objList.add(objNew);
> return oldExchange;
>  
> }
>  
> }
>  
>  
> Can some one please let me know your views what is wrong with my code as i
> am struggling to get this deployed in container. (i am using camel 2.10.4
> and fuseesb 7.1)
>  
>  
>  
>  
> --
> View this message in context: 
> http://servicemix.396122.n5.nabble.com/Unable-to-instantiate-the-aggregation-route-Error-in-Camel-2-10-4-tp5717416.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to