Apache Camel Restlet 无法解析端点,原因是:null: NullPointerException

Apache Camel Restlet failed to resolve endpoint due to: null: NullPointerException

我是 Apache Camel 的新手。 我 运行 带有 CodeReady Studio 12.16 的 Red Hat 中间件。0.GA 在独立的 Spring-boot 环境中作为本地 Camel 上下文。 我用 restlet 组件创建了简单的 Fuse 集成项目,以调用 rest 服务。
这是我的骆驼-context.xml

<?xml version="1.0" encoding="UTF-8"?>
<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 https://www.springframework.org/schema/beans/spring-beans.xsd        http://camel.apache.org/schema/spring       https://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
    <route id="simple-route">
        <from id="route-timer" uri="timer://foo"/>
        <to id="_to1" uri="restlet:http:restcountries.eu:80/rest/v2/alpha/US"/>
        <setBody id="_setBody1">
            <simple>${body}</simple>
        </setBody>
        <log id="route-log" message=">>> ${body}"/>
    </route>
</camelContext>
</beans>

当我 运行 我的项目出现异常时:

[ERROR] Failed to execute goal org.jboss.redhat-fuse:spring-boot-maven-plugin:7.6.0.fuse-760027-redhat-00001:run (default-cli) on project camel-ose-springboot-xml: An exception occurred while running. null: InvocationTargetException: org.apache.camel.FailedToCreateRouteException: Failed to create route simple-route at: >>> To[restlet:http:restcountries.eu:80/rest/v2/alpha/US] <<< in route: Route(simple-route)[[From[timer://foo]] -> [To[restlet:http:... because of Failed to resolve endpoint: restlet://http:restcountries.eu:80//rest/v2/alpha/US due to: null: NullPointerException

怎么了?
提前致谢。

您需要在 pom 文件中添加 camel restlet 依赖项。

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-restlet</artifactId>
    <version>YOUR CAMEL VERSION</version>
</dependency>

或者由于您使用的是 Fuse,您可能需要安装 camel-restlet 功能:

feature:install camel-restlet

用于 restlet 生产者的 URI 无效。您指定的 URL 没有正确指定方案。它应该如下所示(注意在 http: 之后添加 //):

<to id="_to1" uri="restlet:http://restcountries.eu:80/rest/v2/alpha/US"/>