AnsweredAssumed Answered

Running Camel withing Activiti-REST tomcat application

Question asked by mhanrahan on Mar 14, 2014
Latest reply on Mar 21, 2014 by trademak
We are using the Activiti-Camel component to start processes when a message comes in via an activemq queue.  Up until now, we have placed the configuration within the Activiti Explorer Tomcat application, however we have recently been replacing most of the functionality we used explorer for with our own front end accessing the engine via the Activiti REST Tomcat application.

To accomplish this, i just inserted this into the activiti-context.xml file of the REST application:

<import resource="classpath:META-INF/spring/*.xml" />


And within the spring directory we have an xml file containing:

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


 
  <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="brokerURL" value="${broker.activemq.url}" />
    <property name="userName" value="${broker.activemq.username}" />
    <property name="password" value="${broker.activemq.password}" />
  </bean>

  <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
    <routeBuilder ref="routeBuilder" />
    <routeBuilder ref="telflowNBNRoutes" />
  </camelContext>

  <bean id="routeBuilder" class="path.to.my.RouteBuilder" />

</beans>


When I start this up, I get the stack trace:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.activiti.camel.ActivitiComponent': Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.apache.camel.spi.Registry.findByTypeWithName(Ljava/lang/Class;)Ljava/util/Map;
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:331)
        at org.apache.camel.spring.spi.SpringInjector.newInstance(SpringInjector.java:39)
        at org.apache.camel.impl.DefaultComponentResolver.resolveComponent(DefaultComponentResolver.java:87)
        at org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:314)
        … 70 more
Caused by: java.lang.NoSuchMethodError: org.apache.camel.spi.Registry.findByTypeWithName(Ljava/lang/Class;)Ljava/util/Map;
        at org.activiti.camel.ActivitiComponent.getByType(ActivitiComponent.java:49)
        at org.activiti.camel.ActivitiComponent.setCamelContext(ActivitiComponent.java:45)
        at org.apache.camel.impl.DefaultCamelBeanPostProcessor.postProcessBeforeInitialization(DefaultCamelBeanPostProcessor.java:89)
        at org.apache.camel.spring.CamelBeanPostProcessor.postProcessBeforeInitialization(CamelBeanPostProcessor.java:148)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)



Has anyone seen this error before?

Outcomes