Skip to main content
livsey
Bronze ⭐️⭐️⭐️
August 14, 2024
Question

apache nifi 2.0.0 M2 JettyServer Failed

rebooting the machine. I couldn’t find any information about another solution for this problem.

Good afternoon. when starting apache nifi 2.0.0 M2 (as well as M1, M3, M4), after a while it closes with an error, the java_home variable is defined, nifi_properties indicated its IP. please tell me what the problem is and a possible solution

 

nifi-bootstrap.log

2024-08-13 19:59:22,516 WARN [main] o.a.n.b.process.RuntimeValidatorExecutor Runtime Configuration [AvailableLocalPorts] validation failed: Local Ports [28231] less than recommended [55000] according to [/proc/sys/net/ipv4/ip_local_port_range]
2024-08-13 19:59:22,519 WARN [main] o.a.n.b.process.RuntimeValidatorExecutor Runtime Configuration [Swappiness] validation failed: Swappiness [60] more than recommended [0] according to [/proc/sys/vm/swappiness]
2024-08-13 19:59:23,442 INFO [main] org.apache.nifi.bootstrap.RunNiFi {javaVersion=21.0.4, availableProcessors=3, maxOpenFileDescriptors=1048576, totalPhysicalMemoryMB=5921, minimumHeapSize=1g, maximumHeapSize=1g}
2024-08-13 19:59:26,274 INFO [main] org.apache.nifi.bootstrap.Command Generated Self-Signed Certificate Expiration: 2024-10-12
2024-08-13 19:59:26,275 INFO [main] org.apache.nifi.bootstrap.Command Generated Self-Signed Certificate SHA-256: 2464276B1A18B286B653532BA0BAFD6F56F72632BC65437455011985899B4D4B
2024-08-13 19:59:26,822 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
2024-08-13 19:59:26,822 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: /home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2
2024-08-13 19:59:26,822 INFO [main] org.apache.nifi.bootstrap.Command Command: /usr/lib/jvm/jdk-21.0.4-oracle-x64/bin/java -classpath /home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./conf:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-runtime-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-per-process-group-logging-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-python-framework-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/log4j-over-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/jul-to-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/logback-core-1.4.14.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-framework-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-nar-utils-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-server-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-stateless-bootstrap-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/slf4j-api-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-stateless-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-property-utils-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/jcl-over-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/logback-classic-1.4.14.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-properties-2.0.0-M2.jar -Xmx1g -Djava.awt.headless=true -Xms1g -Djavax.security.auth.useSubjectCredsOnly=true -Dsun.net.http.allowRestrictedHeaders=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dcurator-log-only-first-connection-issue-as-error-level=true -Dnifi.properties.file.path=/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./conf/nifi.properties -Dnifi.bootstrap.listen.port=33249 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/logs org.apache.nifi.NiFi
2024-08-13 19:59:26,899 INFO [main] org.apache.nifi.bootstrap.Command Application Process [4533] launched
2024-08-13 19:59:28,297 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 41501
2024-08-13 20:00:10,000 ERROR [NiFi logging handler] org.apache.nifi.StdErr Failed to start web server: Cannot invoke "jakarta.servlet.ServletContext.setAttribute(String, Object)" because "webApiServletContext" is null
2024-08-13 20:00:10,000 ERROR [NiFi logging handler] org.apache.nifi.StdErr Shutting down...
2024-08-13 20:00:10,906 INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi never started. Will not restart NiFi
2024-08-13 20:00:58,578 INFO [main] org.apache.nifi.bootstrap.Command Apache NiFi is not running
2024-08-13 20:18:15,633 WARN [main] o.a.n.b.process.RuntimeValidatorExecutor Runtime Configuration [AvailableLocalPorts] validation failed: Local Ports [28231] less than recommended [55000] according to [/proc/sys/net/ipv4/ip_local_port_range]
2024-08-13 20:18:15,635 WARN [main] o.a.n.b.process.RuntimeValidatorExecutor Runtime Configuration [Swappiness] validation failed: Swappiness [60] more than recommended [0] according to [/proc/sys/vm/swappiness]
2024-08-13 20:18:15,815 INFO [main] org.apache.nifi.bootstrap.RunNiFi {javaVersion=21.0.4, availableProcessors=3, maxOpenFileDescriptors=1048576, totalPhysicalMemoryMB=5921, minimumHeapSize=1g, maximumHeapSize=1g}
2024-08-13 20:18:15,852 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
2024-08-13 20:18:15,853 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: /home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2
2024-08-13 20:18:15,853 INFO [main] org.apache.nifi.bootstrap.Command Command: /usr/lib/jvm/jdk-21.0.4-oracle-x64/bin/java -classpath /home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./conf:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-runtime-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-per-process-group-logging-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-python-framework-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/log4j-over-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/jul-to-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/logback-core-1.4.14.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-framework-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-nar-utils-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-server-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-stateless-bootstrap-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/slf4j-api-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-stateless-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-api-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-property-utils-2.0.0-M2.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/jcl-over-slf4j-2.0.11.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/logback-classic-1.4.14.jar:/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./lib/nifi-properties-2.0.0-M2.jar -Xmx1g -Djava.awt.headless=true -Xms1g -Djavax.security.auth.useSubjectCredsOnly=true -Dsun.net.http.allowRestrictedHeaders=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dcurator-log-only-first-connection-issue-as-error-level=true -Dnifi.properties.file.path=/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/./conf/nifi.properties -Dnifi.bootstrap.listen.port=37363 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=/home/test/Загрузки/nifi-2.0.0-M2-bin/nifi-2.0.0-M2/logs org.apache.nifi.NiFi
2024-08-13 20:18:15,876 INFO [main] org.apache.nifi.bootstrap.Command Application Process [5981] launched
2024-08-13 20:18:16,684 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 39667
2024-08-13 20:18:29,629 ERROR [NiFi logging handler] org.apache.nifi.StdErr Failed to start web server: Cannot invoke "jakarta.servlet.ServletContext.setAttribute(String, Object)" because "webApiServletContext" is null
2024-08-13 20:18:29,629 ERROR [NiFi logging handler] org.apache.nifi.StdErr Shutting down...
2024-08-13 20:18:30,879 INFO [main] org.apache.nifi.bootstrap.RunNiFi NiFi never started. Will not restart NiFi
2024-08-13 20:19:01,246 INFO [main] org.apache.nifi.bootstrap.Command Apache NiFi is not running

 

nifi-app.log

2024-08-13 20:18:29,628 INFO [main] org.eclipse.jetty.server.Server Started oejs.Server@587c5c1{STARTING}[12.0.5,sto=0] @13768ms
2024-08-13 20:18:29,629 WARN [main] org.apache.nifi.web.server.JettyServer Failed to start web server... shutting down.
java.lang.NullPointerException: Cannot invoke "jakarta.servlet.ServletContext.setAttribute(String, Object)" because "webApiServletContext" is null
at org.apache.nifi.web.server.JettyServer.start(JettyServer.java:792)
at org.apache.nifi.NiFi.<init>(NiFi.java:172)
at org.apache.nifi.NiFi.<init>(NiFi.java:83)
at org.apache.nifi.NiFi.main(NiFi.java:332)

8 replies

DianaTorres
Community Manager
Community Manager
August 14, 2024

@livsey Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our NiFi experts @SAMSAL @cotopaul @ckumar  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.

Translate
Regards, Diana Torres, Senior Community Moderator
Samyuktha
Silver ⭐️
October 15, 2024

Did u find any solution for this.Currently I am facing this type of issue

Translate
MattWho
Titanium ⭐️⭐️⭐️
Titanium ⭐️⭐️⭐️
October 15, 2024

@livsey 

Can you share what Java and Java version you are using and how you have configured your Apache NiFi conf/nifi.properties file?

I am most interested in the Web Properties section.

Thank you,
Matt

Translate
Kiranq
Silver ⭐️⭐️⭐️
October 17, 2024

@MattWho 

Hi Matt, I am having the same issue as:

Kiranq_0-1729180126614.png


Here are my web properties:

Kiranq_1-1729180155352.png

 

and java version as below:

Kiranq_2-1729180184230.png

Please suggest any resolution. 

 

Translate
MattWho
Titanium ⭐️⭐️⭐️
Titanium ⭐️⭐️⭐️
October 17, 2024

@Kiranq  @livsey 

If you configure "nifi.web.https.host" with your actual Windows hostname or IP rather then using the loopback address (127.0.0.1), does your NiFi start?

Any custom add-ons?

Have you set NiFi to debug in logback to see if any additional logging shed some light here?

Thanks,
Matt

Translate
Kiranq
Silver ⭐️⭐️⭐️
October 17, 2024

The NiFi actually starts for the first time, if I close it and try to restart it, it never gets restarted again. 

No custom add ons.

I dont know how to debug in logback. 

Translate