Reputation: 9465
We made a distribution of our Play Framework 2.5x app using activator dist. Then unzipped the executable in the target/universal folder and ran the executable in the target/universal/app-ver-SNAPSHOT/bin/ folder using:
./executablename -Dplay.crypto.secret='key' on ubuntu with the following error:
Error: Could not find or load main class play.core.server.ProdServerStart
Our build.sbt file is as follows:
name := """ods-web-tier"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
javaJdbc,
evolutions,
"io.jsonwebtoken" % "jjwt" % "0.6.0",
"mysql" % "mysql-connector-java" % "5.1.36",
"com.mashape.unirest" % "unirest-java" % "1.4.9"
)
sources in (Compile, doc) := Seq.empty
publishArtifact in (Compile, packageDoc) := false
playEbeanModels in Compile := Seq("models.*")
What are we missing here? Please help
Upvotes: 3
Views: 4575
Reputation: 1515
It seems that you did not bundle the dependencies (JARs) you are using with your application. To do so, you can create a fat JAR using sbt assembly
or copy the entire folder produced by the sbt dist
command on your server instead of just the executable.
Upvotes: 1
Reputation: 9465
Thanks, I figured out the issue.
I just transferred the executable file only to the production server. Apparently, we need to transfer the entire zip or unzipped folder as it has the configurations and dependencies
Upvotes: 3