How do I make jetty not create any files?

135 Views Asked by At

i use jetty "org.eclipse.jetty" % "jetty-webapp" % "9.2.19.v20160908" for my web server, and because of security requirements, the readonly file system is installed in the openshift container. As a result, when my server starts, jetty tries to create temporary files, throws out the next exception and after that my service does not work.

2022-07-15 12:35:29.357 [ForkJoinPool-1-worker-1] INFO  org.eclipse.jetty.server.Server - jetty-9.2.z-SNAPSHOT
2022-07-15 12:35:29.657 [ForkJoinPool-1-worker-1] WARN  org.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext@132e1b5e{/,file:/opt/app/lib/src/main/webapp,null}
java.lang.IllegalStateException: Parent for temp dir not configured correctly: writeable=false
    at org.eclipse.jetty.webapp.WebInfConfiguration.makeTempDirectory(WebInfConfiguration.java:336)
    at org.eclipse.jetty.webapp.WebInfConfiguration.resolveTempDirectory(WebInfConfiguration.java:304)
    at org.eclipse.jetty.webapp.WebInfConfiguration.preConfigure(WebInfConfiguration.java:69)
    at org.eclipse.jetty.webapp.WebAppContext.preConfigure(WebAppContext.java:468)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:504)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:387)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:354)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.comp.ccaf.ctl.message_sender_service.rest.FutureRestServer$$anonfun$1.apply$mcV$sp(FutureRestServer.scala:21)
    at com.comp.ccaf.ctl.message_sender_service.rest.FutureRestServer$$anonfun$1.apply(FutureRestServer.scala:19)
    at com.comp.ccaf.ctl.message_sender_service.rest.FutureRestServer$$anonfun$1.apply(FutureRestServer.scala:19)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
    at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
    at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Is there any way to make jetty not create any files?

0

There are 0 best solutions below