让我告诉你一些背景。我在虚拟机中安装了Apache NiFi 1.3.0。Nifi确实收购了Java。java版本如下。
murtaza@wildcat:/nifi-1.3.0/logs$ java -version
openjdk version "9-internal
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)
当我运行或启动NIFI时,它会启动但不显示UI。下面是 NIfi 启动时的输出。
murtaza@wildcat:/nifi-1.3.0/bin$ sudo sh nifi.sh start
nifi.sh: 88: nifi.sh: source: not found
Java home: /usr/lib/jvm/java-9-openjdk-amd64
NiFi home: /nifi-1.3.0
Bootstrap Config File: /nifi-1.3.0/conf/bootstrap.conf
这里的问题是,当我显示端口时,nifi 没有显示其端口 localhost:8080。在这里
murtaza@wildcat:/nifi-1.3.0/bin$ sudo netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1299/nginx -g daemo
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1090/sshd
tcp6 0 0 :::80 :::* LISTEN 1299/nginx -g daemo
tcp6 0 0 :::22 :::* LISTEN 1090/sshd
因此,我无法在浏览器中打开本地主机:8080/nifi,并且确实给出了错误。
我已经尝试了所有方法,但无论如何它对我没有帮助。我认为Java jre或jdk有一个问题。或者可能是 Java 目录。IDK如何读取这些错误日志文件也。日志文件nifi-app.log.下面是日志文件输出。
2017-07-24 14:46:29,363 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi due to java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: Provider org.apache.nifi.processors.enrich.QueryDNS could not be instantiated
java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: Provider org.apache.nifi.processors.enrich.QueryDNS could not be instantiated
at java.util.ServiceLoader.fail(java.base@9-internal/ServiceLoader.java:381)
at java.util.ServiceLoader.access$800(java.base@9-internal/ServiceLoader.java:220)
at java.util.ServiceLoader$LazyClassPathIterator.nextService(java.base@9-internal/ServiceLoader.java:835)
at java.util.ServiceLoader$RestrictedIterator.next(java.base@9-internal/ServiceLoader.java:540)
at java.util.ServiceLoader$2.next(java.base@9-internal/ServiceLoader.java:940)
at org.apache.nifi.nar.ExtensionManager.loadExtensions(ExtensionManager.java:138)
at org.apache.nifi.nar.ExtensionManager.discoverExtensions(ExtensionManager.java:113)
at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:699)
at org.apache.nifi.NiFi.<init>(NiFi.java:160)
at org.apache.nifi.NiFi.main(NiFi.java:267)
Caused by: java.lang.IllegalAccessError: class org.apache.nifi.processors.enrich.QueryDNS (in unnamed module @0x490c7a83) cannot access class com.sun.jndi.dns.DnsContextFactory (in module jdk.naming.dns) because module jdk.naming.dns does not export com.sun.jndi.dns to unnamed module @0x490c7a83
at org.apache.nifi.processors.enrich.QueryDNS.<init>(QueryDNS.java:112)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(java.base@9-internal/Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(java.base@9-internal/NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(java.base@9-internal/DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(java.base@9-internal/Constructor.java:453)
at java.lang.Class.newInstance(java.base@9-internal/Class.java:550)
at java.util.ServiceLoader$LazyClassPathIterator.nextService(java.base@9-internal/ServiceLoader.java:833)
... 7 common frames omitted
2017-07-24 14:46:29,371 INFO [Thread-1] org.apache.nifi.NiFi Initiating shutdown of Jetty web server...
2017-07-24 14:46:29,372 INFO [Thread-1] org.apache.nifi.NiFi Jetty web server shutdown completed (nicely or otherwise).
谁能帮我解决这个问题..我无法理解日志文件。你能帮我解决这个问题吗..谢谢。
似乎是OpenJDK 9中的一个错误:https://bugs.openjdk.java.net/browse/JDK-8153156
我知道Apache Nifi 1.3是用Java 8构建的,所以尝试使用Java 8而不是Java 9
您可以在第 88 行(代码下方(注释代码,它将起作用。
# if [ -f /etc/os-release ]
# then
# source /etc/os-release
# fi