https://kotlinlang.org logo
#http4k
Title
k

kushalp

09/12/2019, 10:04 AM
I appear to be having trouble packaging my http4k application into a fat/shadow JAR. I can happily run the server using
gradle run
but struggle to use the
com.github.johnrengelman.shadow
plugin to create a
shadowJar
. Here's the exception I'm seeing:
Copy code
Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.eclipse.jetty.http.MimeTypes$Type.<init>(MimeTypes.java:98)
	at org.eclipse.jetty.http.MimeTypes$Type.<clinit>(MimeTypes.java:56)
	at org.eclipse.jetty.http.MimeTypes.<clinit>(MimeTypes.java:175)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:805)
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:276)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
	at org.eclipse.jetty.server.Server.start(Server.java:407)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:106)
	at org.eclipse.jetty.server.Server.doStart(Server.java:371)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
	at org.http4k.server.Jetty$toServer$3.start(jetty.kt:33)
	at org.http4k.cloudnative.Http4kK8sServer.start(Http4kK8sServer.kt:22)
	at com.example.AppKt.main(App.kt:37)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at org.eclipse.jetty.http.PreEncodedHttpField.<clinit>(PreEncodedHttpField.java:68)
	... 15 more