Unexpected exception in Play with Scala - scala

I am having an Unexpected exception in my Play2 application with Scala. The same error as mentioned in this question
This is what I get in a browser:
scala.MatchError: java.lang.StackOverflowError (of class
java.lang.StackOverflowError)
play.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44)
play.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44)
scala.Option.map(Option.scala:145)
play.PlayReload$.taskFailureHandler(PlayReload.scala:44)
play.PlayReload$.compileFailure(PlayReload.scala:40)
play.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17)
play.PlayReload$$anonfun$compile$1.apply(PlayReload.scala:17)
scala.util.Either$LeftProjection.map(Either.scala:377)
play.PlayReload$.compile(PlayReload.scala:17)
My stack traces are very large. A part of them looks as follows:
scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5332)
at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5279)
at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5283)
at
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$93.apply(Typers.scala:4440)
[error] (compile:compile) java.lang.StackOverflowError [error]
application -
! Internal server error, for (GET) [/] ->
scala.MatchError: java.lang.StackOverflowError (of class
java.lang.StackOverflowError) at
play.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44)
~[na:na] at
play.PlayReload$$anonfun$taskFailureHandler$1.apply(PlayReload.scala:44)
~[na:na] at scala.Option.map(Option.scala:145)
~[scala-library-2.11.5.jar:na] at
play.PlayReload$.taskFailureHandler(PlayReload.scala:44) ~[na:na] at
play.PlayReload$.compileFailure(PlayReload.scala:40) ~[na:na]
I have tried the answers to change the heap and stack size but when I run jconsole it showed that it did not work.
I also tried to change its heap size from this link but it also did not work and I am still getting the same error.
Here is my build.sbt file :
name := """myproject"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.1"
fork in run := true
javaOptions in run ++= Seq(
"-Xms1G", "-Xmx2G", "-XX:MaxPermSize=1024M", "-XX:+UseConcMarkSweepGC")
//SBT_OPTS=-Xss8m
//JAVA_OPTS="-Xms512m "
//val buildSettings = Defaults.defaultSettings ++ Seq( javaOptions += "-Xms1G -Xmx2G"
//)
libraryDependencies ++= Seq("org.scalatest" %% "scalatest" % "2.2.1" % "test"withSources() withJavadoc(),
"com.esotericsoftware.kryo" % "kryo" % "2.10",
"org.mongodb" %% "casbah" % "2.8.0",
"org.slf4j" % "slf4j-api" % "1.6.4",
"org.elasticsearch" % "elasticsearch" % "1.5.0",
"org.scalatest" %% "scalatest" % "2.2.1" % "test"withSources() withJavadoc(),
"org.easymock" % "easymock" % "3.1" withSources() withJavadoc(),
"org.mockito" % "mockito-all" % "1.9.5",
"com.typesafe.akka" %% "akka-actor" % "2.3.6",
"ch.qos.logback" % "logback-core" % "1.0.9",
"ch.qos.logback" % "logback-classic" % "1.0.9"
)
Please guide me.

Changing the stack size worked for me
I used this command to run the project
activator run -J-Xss4M -server

Related

SQLTimeOutException with slickpg and playframework

I'm in troubles, I don't know why I can't connect to the database, all was ok.
play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[SQLTimeoutException: Timeout after 60001ms of waiting for a connection.]]
at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:293)
at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:220)
at play.api.GlobalSettings$class.onError(GlobalSettings.scala:160)
at play.api.DefaultGlobal$.onError(GlobalSettings.scala:188)
at play.api.http.GlobalSettingsHttpErrorHandler.onServerError(HttpErrorHandler.scala:100)
at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:100)
at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:99)
at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:346)
at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:345)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
Caused by: java.sql.SQLTimeoutException: Timeout after 60001ms of waiting for a connection.
at com.zaxxer.hikari.pool.BaseHikariPool.getConnection(BaseHikariPool.java:227)
at com.zaxxer.hikari.pool.BaseHikariPool.getConnection(BaseHikariPool.java:182)
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:93)
at slick.jdbc.hikaricp.HikariCPJdbcDataSource.createConnection(HikariCPJdbcDataSource.scala:12)
at slick.jdbc.JdbcBackend$BaseSession.conn$lzycompute(JdbcBackend.scala:415)
at slick.jdbc.JdbcBackend$BaseSession.conn(JdbcBackend.scala:414)
at slick.jdbc.JdbcBackend$SessionDef$class.prepareStatement(JdbcBackend.scala:297)
at slick.jdbc.JdbcBackend$BaseSession.prepareStatement(JdbcBackend.scala:407)
at slick.jdbc.StatementInvoker.results(StatementInvoker.scala:33)
at slick.jdbc.StatementInvoker.iteratorTo(StatementInvoker.scala:22)
Caused by: java.sql.SQLException: JDBC4 Connection.isValid() method not supported, connection test query must be configured
at com.zaxxer.hikari.pool.BaseHikariPool.addConnection(BaseHikariPool.java:441)
at com.zaxxer.hikari.pool.BaseHikariPool$1.run(BaseHikariPool.java:413)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 common frames omitted
My application.conf
slick.dbs.default.db.connectionTimeout=60000
slick.dbs.default.driver="utils.db.TetraoPostgresDriver$"
slick.dbs.default.db.driver="org.postgresql.Driver"
slick.dbs.default.db.url="jdbc:postgresql://localhost:5432 /templatesite_db"
slick.dbs.default.db.user="marcus"
slick.dbs.default.db.password="123"
play.http.parser.maxDiskBuffer=100MB
parsers.anyContent.maxLength=100MB
build.sbt
lazy val root = (project in file("."))
.settings(commonSettings: _*)
.settings(routesGenerator := InjectedRoutesGenerator)
.settings(
libraryDependencies += "com.typesafe.slick" %% "slick" % "3.1.1",
libraryDependencies += "com.typesafe.slick" %% "slick-codegen" % "3.1.1",
libraryDependencies += "com.github.tminglei" %% "slick-pg" % "0.14.1",
libraryDependencies += "com.github.tminglei" %% "slick-pg_date2" % "0.14.1",
libraryDependencies += "com.typesafe.play" %% "play-slick" % "2.0.2",
libraryDependencies += "jp.t2v" %% "play2-auth" % "0.14.2",
libraryDependencies += play.sbt.Play.autoImport.cache,
libraryDependencies += "com.github.t3hnar" %% "scala-bcrypt" % "2.6",
libraryDependencies += "org.webjars" %% "webjars-play" % "2.5.0",
libraryDependencies += "org.webjars" % "foundation" % "6.2.3"
).enablePlugins(PlayScala)
resolvers += "Sonatype Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
I think it might be that the HikariCP Module is looking for a connectionTestQuery and not finding it (and throwing the error). Try adding the following to application.conf:
slick.dbs.default.db.connectionTestQuery="/*ping*/ select 1" // or whatever
Answer from: Caused by: java.sql.SQLException: JDBC4 Connection.isValid() method not supported

play.api.UnexpectedException: Unexpected exception[NoClassDefFoundError: slick/backend/DatabaseConfig]

I'm tring to setup a project with play framework and postgres with slick-codegen. My project is compiling without errors And the Tables class generated is correct. But when I run the project it give me the play.api.UnexpectedException: Unexpected exception[NoClassDefFoundError: slick/backend/DatabaseConfig].
This is the full trace:
play.api.UnexpectedException: Unexpected exception[NoClassDefFoundError: slick/backend/DatabaseConfig]
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:184)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(DevServerStart.scala:131)
at scala.Option.map(Option.scala:146)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:131)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1$$anonfun$apply$1.apply(DevServerStart.scala:129)
at scala.util.Success.flatMap(Try.scala:231)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:129)
at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:121)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
Caused by: java.lang.NoClassDefFoundError: slick/backend/DatabaseConfig
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:688)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:616)
at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:572)
at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:558)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:887)
Caused by: java.lang.ClassNotFoundException: slick.backend.DatabaseConfig
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:688)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:380)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:616)
I have my project split in 2 subprojects. The Play project and the codegen project that is used to generate the Tables class.
My build.sbt looks like this:
import sbt.Keys._
val slickVersion = "3.2.0"
scalaVersion := "2.11.8"
// The Play project itself
lazy val root = (project in file("."))
.settings(
libraryDependencies ++= List(
"com.netaporter" %% "scala-uri" % "0.4.14",
"net.codingwell" %% "scala-guice" % "4.1.0",
"com.typesafe.play" %% "play-slick" % "2.0.2",
"com.typesafe.play" %% "play-slick-evolutions" % "2.0.2"
)
)
.settings(sharedSettings)
.enablePlugins(Common, PlayScala)
.settings(
name := """Play app"""
)
.dependsOn(codegen)
lazy val codegen = project
.settings(sharedSettings)
.settings(
libraryDependencies ++= List(
"com.typesafe.slick" %% "slick-codegen" % slickVersion
)
)
lazy val sharedSettings = Seq(
scalaVersion := "2.11.8",
scalacOptions := Seq("-feature", "-unchecked", "-deprecation"),
libraryDependencies ++= List(
"com.typesafe.scala-logging" %% "scala-logging-slf4j" % "2.1.2",
"org.slf4j" % "slf4j-api" % "1.7.23",
"org.slf4j" % "log4j-over-slf4j" % "1.7.23", // for any java classes looking for this
"ch.qos.logback" % "logback-classic" % "1.2.1",
"com.typesafe.slick" %% "slick" % slickVersion,
"org.postgresql" % "postgresql" % "9.4.1212",
"com.github.tminglei" %% "slick-pg" % "0.15.0-RC",
"com.github.tminglei" %% "slick-pg_play-json" % "0.15.0-RC",
"com.github.tminglei" %% "slick-pg_joda-time" % "0.15.0-RC",
"com.github.tminglei" %% "slick-pg_jts" % "0.15.0-RC",
"joda-time" % "joda-time" % "2.9.7",
"org.joda" % "joda-convert" % "1.8"
)
)
I also tried removing all the code that use database and the Tables class but i still get this error.
I use a custom postgres driver and it is in the codegen project but is i add the dependsOn(codegen) in the root project, it should not be a problem. Also it is compling without problems with sbt compile.
EDIT:
After some testings, i changed the slick version to 3.1.1 and com.github.tminglei versions to 0.14.3 and it now works for me.
I had the same classapth problem and in the end used the following versions in a play-2.5.x and scala-2.11 project:
libraryDependencies ++= List(
"com.typesafe.play" %% "play-slick" % "2.1.0",
"com.typesafe.play" %% "play-slick-evolutions" % "2.1.0",
"com.typesafe.slick" %% "slick" % "3.2.0",
"com.github.tototoshi" %% "slick-joda-mapper" % "2.3.0"
}
The slick.backend.DatabaseConfig comes from slick-3.1.0 that was needed by play-slick-2.0.2. Since you wanted slick-3.2.0 you need to use play-slick-2.1.0 see https://github.com/playframework/play-slick and https://github.com/tototoshi/slick-joda-mapper .

Failed running activator run after play-slick upgrade

I have upgraded build.sbt to use the latest play-slick (2.0.0) and after all was downloaded and the application set to run I got this exception.
`
java.lang.NoSuchMethodError: play.api.Logger$.init(Ljava/io/File;Lscala/Enumeration$Value;)V
at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:88)
at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:61)
at play.utils.Threads$.withContextClassLoader(Threads.scala:21)
at play.core.server.DevServerStart$.mainDev(DevServerStart.scala:60)
at play.core.server.DevServerStart$.mainDevHttpMode(DevServerStart.scala:50)
at play.core.server.DevServerStart.mainDevHttpMode(DevServerStart.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at play.runsupport.Reloader$.startDevMode(Reloader.scala:207)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.devModeServer$lzycompute$1(PlayRun.scala:73)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.play$sbt$run$PlayRun$$anonfun$$anonfun$$anonfun$$devModeServer$1(PlayRun.scala:73)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:99)
at play.sbt.run.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$2$$anonfun$apply$3.apply(PlayRun.scala:52)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[trace] Stack trace suppressed: run last compile:run for the full output.
[error] (compile:run) java.lang.reflect.InvocationTargetException
[error] Total time: 0 s, completed 31/ago/2016 23:23:25
`
This is my build.sbt
`
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.7"
libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.22"
libraryDependencies ++= Seq(
//jdbc,
cache,
ws,
specs2 % Test
)
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-slick" % "2.0.0",
"com.typesafe.play" %% "play-slick-evolutions" % "2.0.0"
)
//libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.1.0"
libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.21"
libraryDependencies += "org.slf4j" % "slf4j-simple" % "1.7.21"
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases"
// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator
libraryDependencies += "com.sksamuel.scrimage" %% "scrimage-core" % "2.1.0"
libraryDependencies += "com.sksamuel.scrimage" %% "scrimage-io-extra" % "2.1.0"
libraryDependencies += "com.sksamuel.scrimage" %% "scrimage-filters" % "2.1.0"
`
and my plugins.sbt
`
cat project/plugins.sbt
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.0")
// web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.6")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.7")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.1.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.1.0")
//offline := true
`
I already tried disabling dependencies but that did not solve the issue.
Any ideas?
Your play version "2.4" seems to be incompatible with the upgraded Slick version.
//try this instead in your plugins.sbt
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.5.x")

Play Specs2 test: ReactiveMongoPlugin Error

I'm using Play Framework, Akka Persistent actors and MongoDB.
When I run my Specs2 Test with FakeApplication, java.lang.ExceptionInInitializerError is thrown and the cause is the following:
Caused by: #6md6ke2n9: ReactiveMongoPlugin Error
at play.modules.reactivemongo.ReactiveMongoPlugin$.current(ReactiveMongoPlugin.scala:83)
at play.modules.reactivemongo.ReactiveMongoPlugin$.db(ReactiveMongoPlugin.scala:78)
at models.daos.TaskDAO$.<init>(TaskDAO.scala:25)
at models.daos.TaskDAO$.<clinit>(TaskDAO.scala)
This occurs when ReactiveMongoPlugin.db is invoked.
def db: reactivemongo.api.DB = ReactiveMongoPlugin.db
val futureCollection: Future[JSONCollection] = {
val db = ReactiveMongoPlugin.db
// ...
}
This problem has occurred since I started using PersistentActor. I don't know if there is some conflict between akka-persistence and reactive-mongo dependencies. The following is my build.sbt:
name := "fmcloud"
version := "0.1"
scalaVersion := "2.11.6"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
resolvers := ("Atlassian Releases" at "https://maven.atlassian.com/public/") +: resolvers.value
resolvers += Resolver.sonatypeRepo("snapshots")
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/releases"
libraryDependencies ++= Seq(
"javax.inject" % "javax.inject" % "1",
"org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23",
"net.codingwell" %% "scala-guice" % "4.0.0-beta5",
"org.webjars" % "bootstrap" % "3.3.1",
"org.webjars" % "angularjs" % "1.3.8",
"org.webjars" % "angular-ui-bootstrap" % "0.12.0",
"org.mockito" % "mockito-core" % "1.10.17" % "test",
"com.mohiva" %% "play-silhouette-testkit" % "2.0" % "test",
"com.mohiva" %% "play-silhouette" % "2.0",
"org.json" % "json" % "20141113",
"javax.websocket" % "javax.websocket-client-api" % "1.1",
"org.glassfish.tyrus" % "tyrus-container-grizzly-client" % "1.4",
"com.typesafe.akka" % "akka-testkit_2.11" % "2.3.10",
"com.typesafe.akka" % "akka-persistence-experimental_2.11" % "2.3.10",
"com.github.ironfish" %% "akka-persistence-mongo-casbah" % "0.7.5" % "compile"
)
EDIT: Proably this was an IntelliJ IDEA issue. I updated both IntelliJ and Scala plugin and now there is no ReactiveMongoPlugin Error. Unfortunately now all test-cases work except one (which involves the PersistentActor).
It is still thrown java.lang.ExceptionInInitializerError but the cause is different:
Caused by: java.lang.RuntimeException: There is no started application
at scala.sys.package$.error(package.scala:27)
at play.api.Play$$anonfun$current$1.apply(Play.scala:71)
at play.api.Play$$anonfun$current$1.apply(Play.scala:71)
at scala.Option.getOrElse(Option.scala:121)
at play.api.Play$.current(Play.scala:71)
at models.daos.TaskDAO$.<init>(TaskDAO.scala:26)
at models.daos.TaskDAO$.<clinit>(TaskDAO.scala)
... 19 more
EDIT2: I noticed that this error occurs only when I use TestActorRef of my persistent actor.

Unknown Error from SBT console for dispatch-Http Get request

I m doing simple Http GET request by using dispatch library in SBT.
My Code:
def getReq(){
val svc = url(GlobalObjects.BASE_GET_REQUEST_URL);
val response : Future[String] = Http(svc OK as.String)
response onComplete {
case Success(content) => {
println("Successful response" + content)
}
case Failure(t) => {
println("An error has occurred: " + t.getMessage)
}
}
}
}
When I run from SBT console it shows the following unKnown Error. Someone has any idea what is wrong here?
[error] (run-main) java.lang.NoSuchMethodError: scala.runtime.ObjectRef.zero()Ls
cala/runtime/ObjectRef;
java.lang.NoSuchMethodError: scala.runtime.ObjectRef.zero()Lscala/runtime/Object
Ref;
at dispatch.InternalDefaults$SbtProcessDefaults$.builder(defaults.scala)
at dispatch.InternalDefaults$.client(defaults.scala:32)
at dispatch.Http$.<init>(execution.scala:30)
at dispatch.Http$.<clinit>(execution.scala)
at com.czechscala.blank.User.getReq(User.scala:30)
at com.czechscala.blank.Hello$.main(Hello.scala:81)
at com.czechscala.blank.Hello.main(Hello.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
[trace] Stack trace suppressed: run 'last compile:run' for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run 'last compile:run' for the full output.
[error] (compile:run) Nonzero exit code: 1
[error] Total time: 4 s, completed May 24, 2015 9:00:58 PM
In case I am posting my build.sbt as well.
my build.sbt:
name := "blank"
version := "1.0-SNAPSHOT"
scalaVersion := "2.10.2"
libraryDependencies ++= Seq (
"org.scalatest" % "scalatest_2.10" % "1.9.1" % "test"
)
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.1.2"
)
libraryDependencies ++= Seq(
"net.databinder" %% "dispatch" % "0.8.10"
)
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-actors" % "2.10.2"
)
libraryDependencies ++= Seq(
"net.databinder" %% "dispatch-core" % "0.8.10"
)
libraryDependencies ++= Seq(
"net.databinder" %% "dispatch-futures" % "0.8.10"
)
libraryDependencies ++= Seq(
"net.databinder" %% "dispatch-nio" % "0.8.10"
)
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "1.6.4",
"org.slf4j" % "slf4j-simple" % "1.6.4"
)
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-core" % "3.2.10",
"org.json4s" %% "json4s-native" % "3.2.10",
"org.json4s" %% "json4s-jackson" % "3.2.10",
"net.databinder" %% "unfiltered-netty" % "0.8.0" % "test",
"net.databinder.dispatch" % "dispatch-json4s-native_2.11" % "0.11.1"
)
libraryDependencies ++= Seq(
"io.argonaut" %% "argonaut" % "6.0.4"
)
initialCommands := "import dispatch._"
Seems to be the same issue as with your other question.
net.databinder.dispatch is using 2.11 instead 2.10.