自定义的Nifi处理器抛出构建错误:Nifi nar maven插件中的空指针异常。

huangapple go评论83阅读模式
英文:

Custom Nifi processor throwing build error : Null Pointer Exception from Nifi nar maven plugin

问题

以下是翻译好的内容:

我正在尝试构建带有控制器服务的自定义 Nifi 处理器。我已经配置了项目设置以构建 NAR 文件,但在构建过程中出现以下错误,这似乎来自于 Nifi 库。请告诉我是否存在任何解决方案或可行的解决方法。这似乎是 nif-nar-maven-plugin 的问题,可能与版本有关!!

[INFO] 正在为 NAR 中的 NiFi 扩展生成文档... [INFO] 找到对版本 1.11.4 的 NiFi API 的依赖
[ERROR] 无法生成扩展的文档
org.apache.maven.plugin.MojoExecutionException: 无法创建扩展文档
    at org.apache.nifi.NarMojo.generateDocumentation (NarMojo.java:596)
    at org.apache.nifi.NarMojo.execute (NarMojo.java:499)
    ...
    Caused by: java.lang.NullPointerException
    at org.apache.nifi.NarMojo.getRequiredServiceDefinitions (NarMojo.java:708)
    ...
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
    [INFO] ------------------------------------------------------------------------
    [INFO] custom-processor 1.0-SNAPSHOT 的反应堆摘要:
    [INFO]
    [INFO] custom-processor ................................... 成功 [ 6.729 s]
    [INFO] nifi-sample-api .................................... 成功 [ 4.566 s]
    [INFO] nifi-sample ........................................ 成功 [ 12.118 s]
    [INFO] nifi-custom-processors ............................. 成功 [ 10.350 s]
    [INFO] nifi-custom-nar .................................... 失败 [ 4.535 s]
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] 总时间:44.067 s
    [INFO] 完成于:2020-04-06T22:23:28+05:30
    [INFO] ------------------------------------------------------------------------
    [ERROR] 无法执行目标 org.apache.nifi:nifi-nar-maven-plugin:1.3.1:nar(default-nar),项目 nifi-custom-nar 失败:无法创建扩展文档:NullPointerException -> [帮助

我已经使用了最新的 Nifi 版本,maven-plugin 目录的内容请查看附件中的截图,非常感谢任何帮助。

(附件截图链接已省略)

英文:

I am trying to build custom nifi processor with controller service, I have configured projects setting to build nar files, while building getting following error, this looks to be from nifi libraries, plz let me know is there any solution or workaround exiting for this.This looks to be nif-nar-maven-plugin issue, could problem with version!!

[INFO] Generating documentation for NiFi extensions in the NAR... [INFO] Found a dependency on version 1.11.4 of NiFi API
[ERROR] Could not generate extensions' documentation
org.apache.maven.plugin.MojoExecutionException: Failed to create Extension Documentation
at org.apache.nifi.NarMojo.generateDocumentation (NarMojo.java:596)
at org.apache.nifi.NarMojo.execute (NarMojo.java:499)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NullPointerException
at org.apache.nifi.NarMojo.getRequiredServiceDefinitions (NarMojo.java:708)
at org.apache.nifi.NarMojo.writeDocumentation (NarMojo.java:634)
at org.apache.nifi.NarMojo.writeDocumentation (NarMojo.java:605)
at org.apache.nifi.NarMojo.generateDocumentation (NarMojo.java:577)
at org.apache.nifi.NarMojo.execute (NarMojo.java:499)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for custom-processor 1.0-SNAPSHOT:
[INFO]
[INFO] custom-processor ................................... SUCCESS [ 6.729 s]
[INFO] nifi-sample-api .................................... SUCCESS [ 4.566 s]
[INFO] nifi-sample ........................................ SUCCESS [ 12.118 s]
[INFO] nifi-custom-processors ............................. SUCCESS [ 10.350 s]
[INFO] nifi-custom-nar .................................... FAILURE [ 4.535 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 44.067 s
[INFO] Finished at: 2020-04-06T22:23:28+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.nifi:nifi-nar-maven-plugin:1.3.1:nar (default-nar) on project nifi-custom-nar: Failed to create Extension Documentation: NullPointerException -> [Help

I have used latest Nifi version, the contents of maven-plugin directory find from attachment, any help greatly appreciated自定义的Nifi处理器抛出构建错误:Nifi nar maven插件中的空指针异常。.

答案1

得分: 1

你应该将以下依赖项添加到 NAR 子项目的 pom 文件中。

<dependency>
    <groupId>org.apache.nifi</groupId>
    <artifactId>nifi-standard-services-api-nar</artifactId>
    <version>1.11.4</version>
    <type>nar</type>
</dependency>
英文:

You should add the following dependency in the nar child project's pom file.

    &lt;dependency&gt;
        &lt;groupId&gt;org.apache.nifi&lt;/groupId&gt;
        &lt;artifactId&gt;nifi-standard-services-api-nar&lt;/artifactId&gt;
        &lt;version&gt;1.11.4&lt;/version&gt;
        &lt;type&gt;nar&lt;/type&gt;
    &lt;/dependency&gt;

huangapple
  • 本文由 发表于 2020年4月7日 21:43:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/61081454.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定