#java #json #validation #apache-camel
Вопрос:
Я получаю приведенную ниже ошибку при выполнении следующего оператора в Apache Camel
lt;to id="jsoncheck" uri="json-validator:classpath:jsonschema.json" /gt;
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route3 at: gt;gt;gt; DoTry[[To[json-validator:classpath:jsonschema.json], DoCatch[ null -gt; []]]] lt;lt;lt; in route: Route(route3)[[From[file:///D:/jsonfiles/file?noop=true]] -gt;... 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
Добавлена зависимость
lt;dependencygt; lt;groupIdgt;org.apache.camellt;/groupIdgt; lt;artifactIdgt;camel-json-validatorlt;/artifactIdgt; lt;/dependencygt;
Ответ №1:
Похоже, вы упускаете одну версию.
Я попробовал следующее, и все работает нормально.
lt;dependencygt; lt;groupIdgt;org.apache.camellt;/groupIdgt; lt;artifactIdgt;camel-json-validatorlt;/artifactIdgt; lt;versiongt;3.13.0lt;/versiongt; lt;/dependencygt;