jetty / jetty.project

Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
https://eclipse.dev/jetty
Other
3.86k stars 1.91k forks source link

ExceptionInInitializerError during Device startup on Jetty initialization due to NullPointerException on at org.slf4j.impl.SimpleLogger.write #12444

Closed xuai99 closed 2 weeks ago

xuai99 commented 2 weeks ago

"crashReason": "java.lang.ExceptionInInitializerError", "Back Trace": [ "at com.NetworkApplication.JMDNS.service.core.managers.jettyManager.JettyManager$StartJettyThread.run(JettyManager.java:702)", "at java.lang.Thread.run(Thread.java:1012)Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.PrintStream.println(java.lang.String)' on a null object reference", "at org.slf4j.impl.SimpleLogger.write(SimpleLogger.java:381)", "at org.slf4j.impl.SimpleLogger.log(SimpleLogger.java:376)", "at org.slf4j.impl.SimpleLogger.formatAndLog(SimpleLogger.java:430)", "at org.slf4j.impl.SimpleLogger.info(SimpleLogger.java:562)", "at org.eclipse.jetty.util.log.Slf4jLog.info(Slf4jLog.java:77)", "at org.eclipse.jetty.util.log.Log.initialized(Log.java:170)", "at org.eclipse.jetty.util.log.Log.getLogger(Log.java:278)", "at org.eclipse.jetty.util.log.Log.getLogger(Log.java:267)", "at org.eclipse.jetty.util.component.AbstractLifeCycle.(AbstractLifeCycle.java:36)", "... 2 more" ] }

My android project is pointing to jetty version 9.4.52.v20230823 do i have to upgrade to prevent this issue? if yes what version should i upgrade to?

sbordet commented 2 weeks ago

This is not a Jetty issue.

Jetty uses SLF4J and you are deploying on Android, so you have to find a SLF4J binding that works on Android. You have chosen to use slf4j-simple, which does not work on Android.

joakime commented 2 weeks ago

See https://github.com/nomis/slf4j-android

xuai99 commented 1 week ago

Alright @joakime let me check it out, thanks!