0

私はラクダのルートでスモークトランスフォーメーションを実行しようとしています。私はラクダがそれをネイティブにサポートしているのを見ましたが、私が私の単純なルートを実行すると:

 <beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:camel="http://camel.apache.org/schema/spring"
       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">

  <camel:camelContext xmlns="http://camel.apache.org/schema/spring">
    <!-- here is a sample which processes the input files
         (leaving them in place - see the 'noop' flag)
         then performs content based routing on the message using XPath -->
    <camel:route>
      <camel:from uri="file:src/main/resources/smookFromCsvToXml/from"/>
          <camel:to uri="smooks://src/main/resources/config/smooks.xml"/>
          <camel:to uri="file:src/main/resources/smookFromCsvToXml/to"/>
    </camel:route>
  </camel:camelContext>

</beans>

次のエラーが発生します。

*************************************
Error occurred while running main from: org.apache.camel.spring.Main
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.camel.maven.RunMojo$1.run(RunMojo.java:440)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[smooks://src/main/resources/config/smooks.xml] <<< in route: Route[[From[file:src/main/resources/smookFromCsvToXml/from]]... because of Failed to resolve endpoint: smooks://src/main/resources/config/smooks.xml due to: No component found with scheme: smooks
    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1280)
    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
    at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:280)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
    at org.apache.camel.spring.Main.createDefaultApplicationContext(Main.java:186)
    at org.apache.camel.spring.Main.doStart(Main.java:140)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:140)
    at org.apache.camel.main.MainSupport.run(MainSupport.java:326)
    at org.apache.camel.spring.Main.main(Main.java:73)
    ... 6 more
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[smooks://src/main/resources/config/smooks.xml] <<< in route: Route[[From[file:src/main/resources/smookFromCsvToXml/from]]... because of Failed to resolve endpoint: smooks://src/main/resources/config/smooks.xml due to: No component found with scheme: smooks
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:873)
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:171)
    at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:722)
    at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1779)
    at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1572)
    at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1437)
    at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
    at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:60)
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1405)
    at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)
    at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
    ... 19 more
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: smooks://src/main/resources/config/smooks.xml due to: No component found with scheme: smooks
    at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:485)
    at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:50)
    at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:186)
    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)
    at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)
    at org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)
    at org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)
    at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:441)
    at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:179)
    at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:870)
    ... 29 more
*************************************

アプリケーションはMavenCamelプラグインで実行されるため、pom.xmlは次のとおりです。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.ddelizia</groupId>
  <artifactId>CamelRouterTester</artifactId>
  <packaging>jar</packaging>
  <version>0.0.1-SNAPSHOT</version>

  <name>A Camel Spring Route</name>
  <url>http://www.myorganization.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <camelVersion>2.10.1</camelVersion>
  </properties>

  <repositories>
    <repository>
      <id>release.fusesource.org</id>
      <name>FuseSource Release Repository</name>
      <url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </repository>
    <repository>
      <id>snapshot.fusesource.org</id>
      <name>FuseSource Snapshot Repository</name>
      <url>http://repo.fusesource.com/nexus/content/repositories/snapshots</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
    <repository>
      <id>ea.fusesource.org</id>
      <name>FuseSource Early Access Repository</name>
      <url>http://repo.fusesource.com/nexus/content/groups/ea</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>release.fusesource.org</id>
      <name>FuseSource Release Repository</name>
      <url>http://repo.fusesource.com/nexus/content/repositories/releases</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </pluginRepository>
    <pluginRepository>
      <id>snapshot.fusesource.org</id>
      <name>FuseSource Snapshot Repository</name>
      <url>http://repo.fusesource.com/nexus/content/repositories/snapshots</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </pluginRepository>  
    <pluginRepository>
      <id>ea.fusesource.org</id>
      <name>FuseSource Early Access Repository</name>
      <url>http://repo.fusesource.com/nexus/content/groups/ea</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </pluginRepository>
  </pluginRepositories>

  <dependencies>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
      <version>${camelVersion}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-spring</artifactId>
      <version>${camelVersion}</version>
    </dependency>

    <!-- logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.6.1</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.6.1</version>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.16</version>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test</artifactId>
      <version>${camelVersion}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <defaultGoal>install</defaultGoal>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>

      <!-- allows the route to be ran via 'mvn camel:run' -->
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-maven-plugin</artifactId>
        <version>${camelVersion}</version>
      </plugin>
    </plugins>
  </build>

</project>

したがって、ラクダがこのコンポーネントを取得できないことがわかります(私はラクダのアーティファクトの最後のバージョンを使用しています)。他の依存関係を追加する必要がありますか?

よろしくお願いします

4

1 に答える 1

0

私は解決策を見つけました、私は私のpom.xmlに追加されたsmooksの依存関係を見逃していました:

<dependency>
    <groupId>org.milyn</groupId>
    <artifactId>milyn-smooks-all</artifactId>
    <version>1.5.1</version>
</dependency>

そして今、それは機能します!:)

于 2012-09-21T10:39:38.157 に答える