I built play framework project jar with sbt assembly command. when I run the jar with Java -jar "jarName.jar" it throws error "No root server path supplied" any suggestions ?
I got the same problem when I build a fat jar of my project with this plugin:
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")
and using
sbt assembly
and running it with
java -jar .\myproject-assembly-1.0.jar
This went away when I used:
sbt dists
it will create a zip file containing your application in:
\target\universal\myproject-1.0.zip
copy this file to the server where you want to run it, unpack, then go to the bin directory and run the script, it worked for me:
Linux : bin\myproject
Windows: bin\myproject.bat
val rootDir: File = {
val path = configuration.getOptional[String]("play.server.dir")
.getOrElse(throw ServerStartException("No root server path supplied"))
Shows that the playframework requires a configuration string play.server.dir to be set before it will run.
This is likely happening because you are just running the jar on the command line, or have not followed the deployment / build instructions, or maybe because there is no default configuration defined.
Play deployment instructions can be found here: https://www.playframework.com/documentation/2.6.x/Deploying#Deploying-your-application
Since version 2.7 the Play documentation has a section on Using the sbt assembly plugin, albeit "not officially supported".
The key part is using MergeStrategy.concat
for reference-overrides.conf
files. I also had to do the same for reference.conf
files.
© 2022 - 2024 — McMap. All rights reserved.