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 ?
Play Framework sbt assembly jar running error :- "No root server path supplied"
1.9k views Asked by Bharat At
3
There are 3 answers
0
On
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
1
On
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.
https://github.com/playframework/playframework/blob/master/framework/src/play-server/src/main/scala/play/core/server/ProdServerStart.scala#L91
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