Been getting some strange errors from Jetty: ``` ...
# ktor
n
Been getting some strange errors from Jetty:
Copy code
2019-04-26 13:35:26 DEBUG ManagedSelector:395 - Selector sun.nio.ch.EPollSelectorImpl@3127e5fa waiting with 1 keys
2019-04-26 13:35:26 DEBUG IdleTimeout:156 - SocketChannelEndPoint@1c0f19b5{/192.168.10.40:45496<->/192.168.10.40:10001,OPEN,fill=-,flush=-,to=5/30000}{io=0/0,kio=0,kro=0}-><null> idle timeout check, elapsed: 5 ms, remaining: 29995 ms
2019-04-26 13:35:26 DEBUG SslContextFactory:1645 - Customize sun.security.ssl.SSLEngineImpl@26e0da09
2019-04-26 13:35:26 DEBUG PreEncodedHttpField:64 - HttpField encoders loaded: [org.eclipse.jetty.http2.hpack.HpackFieldPreEncoder@172d9369]
2019-04-26 13:35:26 DEBUG ManagedSelector:671 - 
java.lang.ExceptionInInitializerError
	at org.eclipse.jetty.server.HttpConnection.<clinit>(HttpConnection.java:56)
	at org.eclipse.jetty.server.HttpConnectionFactory.newConnection(HttpConnectionFactory.java:85)
	at org.eclipse.jetty.server.SslConnectionFactory.newConnection(SslConnectionFactory.java:95)
	at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.newConnection(ServerConnector.java:532)
	at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:227)
	at org.eclipse.jetty.io.ManagedSelector.access$1500(ManagedSelector.java:60)
	at org.eclipse.jetty.io.ManagedSelector$Accept.run(ManagedSelector.java:667)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at org.eclipse.jetty.http.PreEncodedHttpField.<clinit>(PreEncodedHttpField.java:71)
	... 10 more
2019-04-26 13:35:26 WARN  ManagedSelector:679 - java.lang.ExceptionInInitializerError
2019-04-26 13:35:26 DEBUG ManagedSelector:680 - 
java.lang.ExceptionInInitializerError
	at org.eclipse.jetty.server.HttpConnection.<clinit>(HttpConnection.java:56)
	at org.eclipse.jetty.server.HttpConnectionFactory.newConnection(HttpConnectionFactory.java:85)
	at org.eclipse.jetty.server.SslConnectionFactory.newConnection(SslConnectionFactory.java:95)
	at org.eclipse.jetty.server.ServerConnector$ServerConnectorManager.newConnection(ServerConnector.java:532)
	at org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:227)
	at org.eclipse.jetty.io.ManagedSelector.access$1500(ManagedSelector.java:60)
	at org.eclipse.jetty.io.ManagedSelector$Accept.run(ManagedSelector.java:667)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at org.eclipse.jetty.http.PreEncodedHttpField.<clinit>(PreEncodedHttpField.java:71)
	... 10 more
2019-04-26 13:35:26 DEBUG QueuedThreadPool:682 - ran org.eclipse.jetty.io.ManagedSelector$Accept@229ba41d
What is really strange is that Jetty has been working fine with SSL connections before. Completely stumped by the errors that have mysteriously appeared. Couldn't have occurred at a more awkward time on a Friday 😱 .
These errors only appear when creating the Jar (via the shadowJar Gradle task), and running the server via the Jar through java. No errors occur if running the server through the build system (via the run Gradle task).
Could a Linux Kernel update cause Jetty to break?
The JDK that is used which contains the java tool is 11.0.2-zulufx (versions are managed by SDK Man), which is also the same version used by the project. This makes the errors all the more perplexing.