0

Error occurred When compiling sbt with CentOS, VirtualBox.

・Environment

  • VirtualBox-5.2.12-122591-Win
  • CentOS-7-x86_64-DVD-1804.iso
  • jre-8u171-linux-i586.tar.gz

it works with Windows OS environment.

install sbt

curl https://bintray.com/sbt/rpm/rpm | sudo tee /etc/yum.repos.d/bintray-sbt-rpm.repo
sudo yum install sbt

sbt version is below

[root@localhost play-scala-rest-api-example]# sbt about
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /home/medical/play-scala-rest-api-example/project
[info] Loading settings from build.sbt ...
[info] Loading settings from build.sbt ...
[info] Set current project to play-scala-rest-api-example (in build file:/home/medical/play-scala-rest-api-example/)
[info] This is sbt 1.1.0
[info] The current project is ProjectRef(uri("file:/home/medical/play-scala-rest-api-example/"), "root") 1.0-SNAPSHOT
[info] The current project is built against Scala 2.12.4
[info] Available Plugins: sbt.plugins.IvyPlugin, sbt.plugins.JvmPlugin, sbt.plugins.CorePlugin, sbt.plugins.JUnitXmlReportPlugin, sbt.plugins.Giter8TemplatePlugin, play.sbt.Play, play.sbt.PlayAkkaHttp2Support, play.sbt.PlayAkkaHttpServer, play.sbt.PlayFilters, play.sbt.PlayJava, play.sbt.PlayLayoutPlugin, play.sbt.PlayLogback, play.sbt.PlayMinimalJava, play.sbt.PlayNettyServer, play.sbt.PlayScala, play.sbt.PlayService, play.sbt.routes.RoutesCompiler, play.sbt.test.MediatorWorkaroundPlugin, play.twirl.sbt.SbtTwirl, com.typesafe.sbt.SbtNativePackager, com.typesafe.sbt.packager.archetypes.JavaAppPackaging, com.typesafe.sbt.packager.archetypes.JavaServerAppPackaging, com.typesafe.sbt.packager.archetypes.jar.ClasspathJarPlugin, com.typesafe.sbt.packager.archetypes.jar.LauncherJarPlugin, com.typesafe.sbt.packager.archetypes.scripts.AshScriptPlugin, com.typesafe.sbt.packager.archetypes.scripts.BashStartScriptPlugin, com.typesafe.sbt.packager.archetypes.scripts.BatStartScriptPlugin, com.typesafe.sbt.packager.archetypes.systemloader.SystemVPlugin, com.typesafe.sbt.packager.archetypes.systemloader.SystemdPlugin, com.typesafe.sbt.packager.archetypes.systemloader.SystemloaderPlugin, com.typesafe.sbt.packager.archetypes.systemloader.UpstartPlugin, com.typesafe.sbt.packager.debian.DebianDeployPlugin, com.typesafe.sbt.packager.debian.DebianPlugin, com.typesafe.sbt.packager.debian.JDebPackaging, com.typesafe.sbt.packager.docker.DockerPlugin, com.typesafe.sbt.packager.docker.DockerSpotifyClientPlugin, com.typesafe.sbt.packager.jdkpackager.JDKPackagerDeployPlugin, com.typesafe.sbt.packager.jdkpackager.JDKPackagerPlugin, com.typesafe.sbt.packager.linux.LinuxPlugin, com.typesafe.sbt.packager.rpm.RpmDeployPlugin, com.typesafe.sbt.packager.rpm.RpmPlugin, com.typesafe.sbt.packager.universal.UniversalDeployPlugin, com.typesafe.sbt.packager.universal.UniversalPlugin, com.typesafe.sbt.packager.windows.WindowsDeployPlugin, com.typesafe.sbt.packager.windows.WindowsPlugin, com.lightbend.sbt.javaagent.JavaAgent, com.lightbend.sbt.javaagent.JavaAgentPackaging, com.typesafe.sbt.web.SbtWeb, com.typesafe.sbt.jse.SbtJsEngine, com.typesafe.sbt.jse.SbtJsTask, com.lightbend.paradox.sbt.ParadoxPlugin, io.gatling.sbt.GatlingPlugin, com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin, com.lucidchart.sbt.scalafmt.ScalafmtPlugin, com.lucidchart.sbt.scalafmt.ScalafmtSbtPlugin, com.heroku.sbt.HerokuPlugin, Common
[info] sbt, sbt plugins, and build definitions are using Scala 2.12.4
[INFO] [05/28/2018 11:54:00.730] [Thread-2] [CoordinatedShutdown(akka://sbt-web)] Starting coordinated shutdown from JVM shutdown hook

My build.sbt file is

import sbt.Keys._

lazy val GatlingTest = config("gatling") extend Test

scalaVersion in ThisBuild := "2.12.4"

crossScalaVersions := Seq("2.11.12", "2.12.4")

def gatlingVersion(scalaBinVer: String): String = scalaBinVer match {
  case "2.11" => "2.2.5"
  case "2.12" => "2.3.0"
}

libraryDependencies += guice
libraryDependencies ++= Seq( jdbc)
libraryDependencies += "org.joda" % "joda-convert" % "1.9.2"
libraryDependencies += "net.logstash.logback" % "logstash-logback-encoder" % "4.11"

libraryDependencies += "com.netaporter" %% "scala-uri" % "0.4.16"
libraryDependencies += "net.codingwell" %% "scala-guice" % "4.1.1"

libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "3.1.2" % Test
libraryDependencies += "io.gatling.highcharts" % "gatling-charts-highcharts" % gatlingVersion(scalaBinaryVersion.value) % Test
libraryDependencies += "io.gatling" % "gatling-test-framework" % gatlingVersion(scalaBinaryVersion.value) % Test
libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.45"
libraryDependencies += "org.postgresql" % "postgresql" % "9.4.1208.jre7"
libraryDependencies += jdbc

// The Play project itself
lazy val root = (project in file("."))
  .enablePlugins(Common, PlayScala, GatlingPlugin)
  .configs(GatlingTest)
  .settings(inConfig(GatlingTest)(Defaults.testSettings): _*)
  .settings(
    name := """play-scala-rest-api-example""",
    scalaSource in GatlingTest := baseDirectory.value / "/gatling/simulation"
  )

// Documentation for this project:
//    sbt "project docs" "~ paradox"
//    open docs/target/paradox/site/index.html
lazy val docs = (project in file("docs")).enablePlugins(ParadoxPlugin).
  settings(
    paradoxProperties += ("download_url" -> "https://example.lightbend.com/v1/download/play-rest-api")
  )
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc" % "3.2.1"
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-config"  % "3.2.1"
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-play-initializer" % "2.6.0-scalikejdbc-3.2"
libraryDependencies += "org.scalikejdbc" %% "scalikejdbc-play-dbapi-adapter" % "2.6.0-scalikejdbc-3.2"
libraryDependencies += "org.flywaydb" %% "flyway-play" % "4.0.0"
libraryDependencies += "org.scalikejdbc"      %% "scalikejdbc-play-fixture"      % "2.6.0-scalikejdbc-3.2"
libraryDependencies += ws
herokuAppName in Compile := "obscure-sierra-7788"
// 文字変換ライブラリ
libraryDependencies += "com.ibm.icu" % "icu4j" % "60.2"

enablePlugins(JavaAppPackaging)

When I compile it I get the following errors:

[root@localhost play-scala-rest-api-example]# sbt compile
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from /home/medical/play-scala-rest-api-example/project
[info] Loading settings from build.sbt ...
[info] Loading settings from build.sbt ...
[info] Set current project to play-scala-rest-api-example (in build file:/home/medical/play-scala-rest-api-example/)
[info] Executing in batch mode. For better performance use sbt's shell
[info] Compiling 163 Scala sources and 1 Java source to /home/medical/play-scala-rest-api-example/target/scala-2.12/classes ...
[warn] /home/medical/play-scala-rest-api-example/app/donuts/common/ApiError.scala:69:69: parameter value lang in method errorValidation is never used
[warn]   def errorValidation(badJson:Option[JsValue])(implicit m:Messages, lang:Lang) = apply(VALIDATION_ERROR, Messages(VALIDATION_ERROR),badJson)
[warn]                                                                     ^
[warn] /home/medical/play-scala-rest-api-example/app/donuts/common/ApiError.scala:70:47: parameter value lang in method errorLoginRequired is never used
[warn]   def errorLoginRequired(implicit m:Messages, lang:Lang) = apply(LOGIN_REQUIRED,Messages(LOGIN_REQUIRED))
[warn]                                               ^
[warn] /home/medical/play-scala-rest-api-example/app/donuts/common/ApiError.scala:71:43: parameter value lang in method errorForbidden is never used
[warn]   def errorForbidden(implicit m:Messages, lang:Lang) = apply(FORBIDDEN, Messages(FORBIDDEN))
[warn]                                           ^
[warn] /home/medical/play-scala-rest-api-example/app/donuts/common/ApiError.scala:72:56: parameter value lang in method errorResourceAlreadyExists is never used
[warn]   def errorResourceAlreadyExists( implicit m:Messages, lang:Lang) = apply(RESOURCE_ALREADY_EXISTS,Messages(RESOURCE_ALREADY_EXISTS))
[warn]                                                        ^
[warn] /home/medical/play-scala-rest-api-example/app/donuts/common/ApiError.scala:73:61: parameter value lang in method errorBadClinicId is never used
[warn]   def errorBadClinicId(clinicId:Long)( implicit m:Messages, lang:Lang) = apply(BAD_CLINIC_ID,Messages(BAD_CLINIC_ID,clinicId))
[warn]                                                             ^
[warn] /home/medical/play-scala-rest-api-example/app/donuts/common/ApiError.scala:74:62: parameter value lang in method errorBadPatientId is never used
[warn]   def errorBadPatientId(patientId:Long)(implicit m:Messages, lang:Lang) = apply(BAD_PATIENT_ID,Messages(BAD_PATIENT_ID,patientId))
[warn]                                                              ^

/usr/share/sbt/bin/sbt-launch-lib.bash: line 58: 4341 Killed "$@"

Please advice how to fix it.

donuts
  • 1
  • 2
  • Could you add the class definition/signature in your `ApiError.scala` file? – o-0 May 28 '18 at 03:58
  • 1
    Could be killed by out of memory. Is this in a docker container? Is there an out of memory error in the log if you run `dmesg`? – Robin Green May 28 '18 at 07:14
  • I have solved the problem. Thank you for – donuts May 30 '18 at 06:08
  • I have solved the problem by myself. Some action was runned by root user, and other by original user. therefore start all over again by original user, and it works. Thank you for advice. – donuts May 30 '18 at 06:52

0 Answers0