Search code examples
apache-camelvelocityapache-servicemix

camel component 'velocity' not found


I implement *.vm template in my routing application (Servicemix) but after deploying JAR archive I get this error

karaf@root> Exception in thread "SpringOsgiExtenderThread-38" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route14 at: >>> To[velocity:getPayments.vm] <<< in route: Route(route14)[[From[direct:start]] -> [To[velocity:getPayme... because of Failed to resolve endpoint: velocity://getPayments.vm due to: No component found with scheme: velocity

I followed this manual http://camel.apache.org/tutorial-example-reportincident-part4.html

and pointed camel-velocity in pom.xml with same camel-core version

<dependency>
 <groupId>org.apache.camel</groupId>
 <artifactId>camel-core</artifactId>
 <version>2.13.1</version>
</dependency>

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-velocity</artifactId>
  <version>2.13.1</version>
</dependency>

Does anybody know, what the matter is ?


Solution

  • nothing changed even after ServiceMix restarting, but I found solution. after init-ing of CamelContext I add camel components manually.

    import org.apache.camel.component.velocity.*;
    import org.apache.camel.component.spring.ws.*;
    
    ....
    
    private CamelContext camel;
    
    .....
    
    camel = new DefaultCamelContext();
    camel.addComponent("velocity", new VelocityComponent());
    camel.addComponent("spring-ws",new SpringWebserviceComponent());