title: Playframework [Scala]: The app cannot access its assets in production
body: <p>I'm getting an error regarding accessing assets, while running my app in production (works fine on during development): </p>
  
  <pre><code>[info] play.api.Play - Application started (Prod)
  [info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
  [error] application - 
  
  ! @784kabl4n - Internal server error, for (GET) [/assets/images/favicon.png] -&gt;
  
  play.api.UnexpectedException: Unexpected exception[RuntimeException: java.lang.IllegalAccessError: class play.utils.Resources$ (in unnamed module @0x67dd1848) cannot access class sun.net.www.protocol.file.FileURLConnection (in module java.base) because module java.base does not export sun.net.www.protocol.file to unnamed module @0x67dd1848]
      at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:251)
      at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:182)
      at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:343)
      at play.core.server.AkkaHttpServer$$anonfun$2.applyOrElse(AkkaHttpServer.scala:341)
      at scala.concurrent.Future.$anonfun$recoverWith$1(Future.scala:414)
      at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
      at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
      at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
      at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
      at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
  Caused by: java.lang.RuntimeException: java.lang.IllegalAccessError: class play.utils.Resources$ (in unnamed module @0x67dd1848) cannot access class sun.net.www.protocol.file.FileURLConnection (in module java.base) because module java.base does not export sun.net.www.protocol.file to unnamed module @0x67dd1848
      at play.api.mvc.ActionBuilder$$anon$2.apply(Action.scala:424)
      at play.api.mvc.Action.$anonfun$apply$2(Action.scala:96)
      at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$4(Accumulator.scala:174)
      at scala.util.Try$.apply(Try.scala:209)
      at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$3(Accumulator.scala:174)
      at scala.Function1.$anonfun$andThen$1(Function1.scala:52)
      at scala.Function1.$anonfun$andThen$1(Function1.scala:52)
      at scala.Function1.$anonfun$andThen$1(Function1.scala:52)
      at play.api.libs.streams.StrictAccumulator.run(Accumulator.scala:207)
      at play.core.server.AkkaHttpServer.$anonfun$runAction$4(AkkaHttpServer.scala:337)
  Caused by: java.lang.IllegalAccessError: class play.utils.Resources$ (in unnamed module @0x67dd1848) cannot access class sun.net.www.protocol.file.FileURLConnection (in module java.base) because module java.base does not export sun.net.www.protocol.file to unnamed module @0x67dd1848
      at play.utils.Resources$.isUrlConnectionADirectory(Resources.scala:32)
      at controllers.AssetsBuilder.$anonfun$assetAt$3(Assets.scala:817)
      at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:304)
      at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
      at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
      at play.api.libs.streams.Execution$trampoline$.execute(Execution.scala:70)
      at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:68)
      at scala.concurrent.impl.Promise$DefaultPromise.dispatchOrAddCallback(Promise.scala:312)
      at scala.concurrent.impl.Promise$DefaultPromise.onComplete(Promise.scala:303)
      at scala.concurrent.impl.Promise.transformWith(Promise.scala:36)
  </code></pre>
  
  <p>I can access the application itself over http/https while Nginx acts as a proxy, but it seems the Play application itself cannot get the assets. </p>
  
  <p>The <code>route</code> regarding assets is: </p>
  
  <pre><code>GET          /assets/*file             controllers.Assets.versioned(file)
  </code></pre>
  
  <p>and within the <code>views</code> I have: </p>
  
  <pre><code>&lt;head&gt;
      &lt;link rel="shortcut icon" type="image/png" href="@assetsFinder.path("images/favicon.png")"&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>Any idea how I can debug this?</p>