在Apache Camel 中运行以下语句时,我收到以下错误
<to id="jsoncheck" uri="json-validator:classpath:jsonschema.json" />
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route3 at: >>> DoTry[[To[json-validator:classpath:jsonschema.json], DoCatch[ null -> []]]] <<< in route: Route(route3)[[From[file:///D:/jsonfiles/file?noop=true]] ->... because of Failed to resolve endpoint: json-validator://classpath:jsonschema.json due to: No component found with scheme: json-validator
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:912)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:778)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1955)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1705)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1579)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1547)
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:221)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
... 10 more
已添加依赖项
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-json-validator</artifactId>
</dependency>
似乎错过了一个版本。
我试过以下方法,一切都很好。
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-json-validator</artifactId>
<version>3.13.0</version>
</dependency>