【问题标题】:NIFI: No controller service types found that are applicable for this propertyNIFI:未找到适用于此属性的控制器服务类型
【发布时间】:2018-08-01 15:07:39
【问题描述】:

我正在为 Apache NiFi 开发 Milo OPCUA 处理器和服务。 处理器和服务编译得很好,我可以用它们启动 NiFi。但是,当尝试为我刚刚添加的处理器配置服务时,它只会显示“未找到适用于此属性的控制器服务类型。”。

这是我的 POM:

处理器 JAR

<parent>
    <groupId>com.tcon</groupId>
    <artifactId>pubsub</artifactId>
    <version>0.1</version>
</parent>

<artifactId>nifi-pubsub-processors</artifactId>
<packaging>jar</packaging>

<dependencies>
    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-utils</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-mock</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>tcon</groupId>
        <artifactId>nifi-miloservice-api</artifactId>
        <version>0.1</version>
    </dependency>
</dependencies>

处理器 NAR

<parent>
    <groupId>com.tcon</groupId>
    <artifactId>pubsub</artifactId>
    <version>0.1</version>
</parent>

<artifactId>nifi-pubsub-nar</artifactId>
<version>0.1</version>
<packaging>nar</packaging>
<properties>
    <maven.javadoc.skip>true</maven.javadoc.skip>
    <source.skip>true</source.skip>
</properties>

<dependencies>
    <dependency>
        <groupId>com.tcon</groupId>
        <artifactId>nifi-pubsub-processors</artifactId>
        <version>0.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.nifi</groupId>
        <artifactId>nifi-standard-services-api-nar</artifactId>
        <version>1.2.0</version>
        <type>nar</type>
    </dependency>
</dependencies>

服务 POM 应该不重要,afaik。它们没有被修改,除了一些 Milo 依赖项。

如您所见,处理器 JAR POM 具有来自我的自定义服务的自定义服务 API 依赖项,处理器 NAR POM 具有来自 nifi 的标准 API 依赖项。

文档说这就是我将处理器“链接”到我的服务所需要做的一切。

我错过了什么?

【问题讨论】:

    标签: java maven apache-nifi


    【解决方案1】:

    您还需要通过在处理器 JAR 项目的 src/main/resources 文件夹中包含一个文件来向 ServiceLoader 注册您的控制器服务。您需要在资源文件夹下有一个 META-INF/services 文件夹,其中包含一个名为 org.apache.nifi.controller.ControllerService 的文件,其中一行包含实现 ControllerService 接口的类的完全限定名称。

    【讨论】:

    • 原来是问题所在。但我还需要服务 api JAR 依赖项和控制器的完整服务 JAR 依赖项。我在那里做错了吗?谢谢你的建议。
    猜你喜欢
    • 2014-05-14
    • 1970-01-01
    • 2023-04-10
    • 2019-05-06
    • 1970-01-01
    • 2014-12-09
    • 2023-03-08
    • 2021-11-20
    • 1970-01-01
    相关资源
    最近更新 更多