代码之家  ›  专栏  ›  技术社区  ›  Vijay Kumar

org.apache.nifi.web.NiFiCoreException:无法启动流控制器

  •  0
  • Vijay Kumar  · 技术社区  · 6 年前

    我正在建立一个包含3个节点的NiFi 1.7.1版本构建集群。 我正在使用其他3个节点作为zookeeper(不使用嵌入式zk) 使用Java1.8构建181

    使用外部zookeeper以群集模式启动Nifi时出现此错误

    2018-08-21 19:58:49,675 INFO [main] org.apache.nifi.bootstrap.Command Launched Apache NiFi with Process ID 14956
    2018-08-21 19:58:50,156 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 44710
    2018-08-21 19:59:09,700 ERROR [NiFi logging handler] org.apache.nifi.StdErr Failed to start web server: Unable to start Flow Controller.
    2018-08-21 19:59:09,701 ERROR [NiFi logging handler] org.apache.nifi.StdErr Shutting down...
    2018-08-21 19:59:10,679 INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi never started. Will not restart NiFi
    

    Nidi-App.log文件

    2018-08-21 19:59:09,222 WARN [main] org.eclipse.jetty.webapp.WebAppContext Failed startup of context o.e.j.w.WebAppContext@7115d5af{/nifi-api,file:///opt/nifi-1.7.1/work/jetty/nifi-web-api-1.7.1.war/webapp/,UNAVAILABLE}{./work/nar/framework/nifi-framework-nar-1.7.1.nar-unpacked/META-INF/bundled-dependencies/nifi-web-api-1.7.1.war}
    org.apache.nifi.web.NiFiCoreException: Unable to start Flow Controller.
            at org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:88)
            at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:876)
            at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:532)
            at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:839)
            at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:344)
            at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1480)
            at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1442)
            at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:799)
            at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
            at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:540)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
            at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
            at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
            at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
            at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
            at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
            at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
            at org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:290)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
            at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
            at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:113)
            at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
            at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
            at org.eclipse.jetty.server.Server.start(Server.java:452)
            at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
            at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
            at org.eclipse.jetty.server.Server.doStart(Server.java:419)
            at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
            at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:838)
            at org.apache.nifi.NiFi.<init>(NiFi.java:157)
            at org.apache.nifi.NiFi.<init>(NiFi.java:71)
            at org.apache.nifi.NiFi.main(NiFi.java:292)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowService': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowController' defined in class path resource [nifi-context.xml]: Cannot resolve reference to bean 'clusterCoordinator' while setting bean property 'clusterCoordinator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clusterCoordinator': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clusterCoordinationProtocolSenderListener' defined in class path resource [nifi-cluster-protocol-context.xml]: Cannot resolve reference to bean 'protocolListener' while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'protocolListener' defined in class path resource [nifi-cluster-protocol-context.xml]: Unsatisfied dependency expressed through constructor parameter 1: Could not convert argument value of type [null] to required type [int]: Failed to convert value of type 'null' to required type 'int'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type 'null' to required type 'int': PropertyEditor [org.springframework.beans.propertyeditors.CustomNumberEditor] returned inappropriate value of type 'null'
            at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
            at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1634)
            at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:317)
            at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
            at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1084)
            at org.apache.nifi.web.contextlistener.ApplicationStartupContextListener.contextInitialized(ApplicationStartupContextListener.java:55)
            ... 33 common frames omitted
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flowController' defined in class path resource [nifi-context.xml]: Cannot resolve reference to bean 'clusterCoordinator' while setting bean property 'clusterCoordinator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clusterCoordinator': FactoryBean threw exception on object creation; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'clusterCoordinationProtocolSenderListener' defined in class path resource [nifi-cluster-protocol-context.xml]: Cannot resolve reference to bean 'protocolListener' while setting constructor argument; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with:
    
    1 回复  |  直到 6 年前
        1
  •  2
  •   Andy    6 年前

    异常的原始原因是 Error creating bean with name 'protocolListener' defined in class path resource [nifi-cluster-protocol-context.xml]: Unsatisfied dependency expressed through constructor parameter 1: Could not convert argument value of type [null] to required type [int]: ... 参数1 参数)的 protocolListener clusterNodeProtocolPort :

        <!-- protocol listener -->
        <bean id="protocolListener" class="org.apache.nifi.cluster.protocol.impl.SocketProtocolListener">
            <constructor-arg index="0">
                <bean factory-bean="nifiProperties" factory-method="getClusterNodeProtocolThreads"/>
            </constructor-arg>
            <constructor-arg index="1">
                <bean factory-bean="nifiProperties" factory-method="getClusterNodeProtocolPort"/>
            </constructor-arg>
            <constructor-arg ref="protocolServerSocketConfiguration" index="2"/>
            <constructor-arg ref="protocolContext" index="3"/>
        </bean>
    

    nifi.properties 文件,你应该有: nifi.cluster.node.protocol.port=11443 或其他端口号。我猜你的 nifi.属性 . 请记住在每个节点上设置它,并确保端口在同一台计算机上运行时不会发生冲突。