title: Play 2.8.8 Deployment on Heroku crashes while starting the server
body: <p>I'm trying to deploy a Scala Play project on Heroku via Heroku CLI.</p>
  <p>It works well, but when the server tries to start it crashes with the following error:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>2021-08-17T16:47:52.333689+00:00 app[web.1]: at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
  2021-08-17T16:47:52.333713+00:00 app[web.1]: at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
  2021-08-17T16:47:52.333753+00:00 app[web.1]: at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
  2021-08-17T16:47:52.333762+00:00 app[web.1]: at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
  2021-08-17T16:47:52.333789+00:00 app[web.1]: at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
  2021-08-17T16:47:52.333813+00:00 app[web.1]: at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
  2021-08-17T16:47:52.333838+00:00 app[web.1]: at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:213)
  2021-08-17T16:47:52.333867+00:00 app[web.1]: at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
  2021-08-17T16:47:52.333893+00:00 app[web.1]: at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:111)
  2021-08-17T16:47:52.333919+00:00 app[web.1]: at com.google.inject.Guice.createInjector(Guice.java:87)
  2021-08-17T16:47:52.333942+00:00 app[web.1]: at com.google.inject.Guice.createInjector(Guice.java:78)
  2021-08-17T16:47:52.333968+00:00 app[web.1]: at play.api.inject.guice.GuiceBuilder.injector(GuiceInjectorBuilder.scala:200)
  2021-08-17T16:47:52.333993+00:00 app[web.1]: at play.api.inject.guice.GuiceApplicationBuilder.build(GuiceApplicationBuilder.scala:155)
  2021-08-17T16:47:52.334018+00:00 app[web.1]: at play.api.inject.guice.GuiceApplicationLoader.load(GuiceApplicationLoader.scala:21)
  2021-08-17T16:47:52.334042+00:00 app[web.1]: at play.core.server.ProdServerStart$.start(ProdServerStart.scala:53)
  2021-08-17T16:47:52.334076+00:00 app[web.1]: at play.core.server.ProdServerStart$.main(ProdServerStart.scala:29)
  2021-08-17T16:47:52.334102+00:00 app[web.1]: at play.core.server.ProdServerStart.main(ProdServerStart.scala)
  2021-08-17T16:47:52.408221+00:00 heroku[web.1]: Process exited with status 255
  2021-08-17T16:47:52.471552+00:00 heroku[web.1]: State changed from starting to crashed
  2021-08-17T16:47:52.490499+00:00 heroku[web.1]: State changed from crashed to starting
  2021-08-17T16:47:58.797308+00:00 heroku[web.1]: Starting process with command `target/universal/stage/bin/bionplaydatawarehouse -Dhttp.port=${PORT}`
  2021-08-17T16:48:01.183756+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
  2021-08-17T16:48:01.398386+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UTF-8
  2021-08-17T16:48:06.203049+00:00 app[web.1]: WARNING: An illegal reflective access operation has occurred
  2021-08-17T16:48:06.203069+00:00 app[web.1]: WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/app/target/universal/stage/lib/com.google.inject.guice-4.2.3.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
  2021-08-17T16:48:06.203069+00:00 app[web.1]: WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
  2021-08-17T16:48:06.203070+00:00 app[web.1]: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  2021-08-17T16:48:06.203076+00:00 app[web.1]: WARNING: All illegal access operations will be denied in a future release
  2021-08-17T16:48:15.071607+00:00 app[web.1]: Oops, cannot start the server.</code></pre>
  </div>
  </div>
  </p>
  <p>The projet parameters are:</p>
  <ul>
  <li>Play 2.8.8</li>
  <li>Scala 2.13.5</li>
  <li>SBT 1.5.0</li>
  <li>Java 11</li>
  </ul>
  <p>The project is based on an IntelliJ Ultimate Template.</p>
  <p>The Heroku Procfile looks like this:</p>
  <pre><code>web: target/universal/stage/bin/bionplaydatawarehouse -Dhttp.port=${PORT}
  </code></pre>
  <p>The system.properties file looks like this to overwrite the default Java 8 Version:</p>
  <pre><code>java.runtime.version=11
  </code></pre>
  <p>When I change the Java Version the compilation crashes with a Class Cast Exception.</p>
  <p>It seems that the Guice DI is the problem or some configuration parameter is missing for the Heroku production invironment because locally the projects works well.</p>