So, i study play 2 framework + slick. code is simple query to db with slick. And get exception. And I don't understand what to do.
my controller:
class IndexController #Inject()(taskRepo: TaskRepo) extends Controller {
def index = Action.async { implicit rs =>
taskRepo.all().map(tasks => Ok(views.html.index(tasks)))
}
}
and exception:
[info] ! #6pp163f7m - Internal server error, for (GET) [/] ->
[info]
[info] play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[PrivilegedActionException: null]]
[info] at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:269)
[info] at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:195)
[info] at play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala:45)
[info] at play.core.server.Server$class.getHandlerFor(Server.scala:65)
[info] at play.core.server.NettyServer.getHandlerFor(NettyServer.scala:45)
[info] at play.core.server.netty.PlayRequestHandler.handle(PlayRequestHandler.scala:81)
[info] at play.core.server.netty.PlayRequestHandler.channelRead(PlayRequestHandler.scala:162)
[info] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:307)
[info] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:293)
[info] at com.typesafe.netty.http.HttpStreamsHandler.channelRead(HttpStreamsHandler.java:129)
[info] Caused by: java.security.PrivilegedActionException: null
[info] at java.security.AccessController.doPrivileged(Native Method)
[info] at play.runsupport.Reloader$.play$runsupport$Reloader$$withReloaderContextClassLoader(Reloader.scala:39)
[info] at play.runsupport.Reloader.reload(Reloader.scala:336)
[info] at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:118)
[info] at play.core.server.DevServerStart$$anonfun$mainDev$1$$anon$1$$anonfun$get$1.apply(DevServerStart.scala:116)
[info] at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
[info] at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
[info] at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
[info] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
[info] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
[info] Caused by: java.util.concurrent.TimeoutException: Futures timed out after [300000 milliseconds]
[info] at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:219)
[info] at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:223)
[info] at scala.concurrent.Await$$anonfun$result$1.apply(package.scala:190)
[info] at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:53)
[info] at scala.concurrent.Await$.result(package.scala:190)
[info] at play.forkrun.ForkRun$$anonfun$askForReload$1.apply(ForkRun.scala:128)
[info] at play.forkrun.ForkRun$$anonfun$askForReload$1.apply(ForkRun.scala:126)
[info] at play.runsupport.Reloader$$anonfun$reload$1.apply(Reloader.scala:338)
[info] at play.runsupport.Reloader$$anon$3.run(Reloader.scala:43)
[info] at java.security.AccessController.doPrivileged(Native Method)
what i do wrong?
Problem was in Futures timed out after [300000 milliseconds]
in build.sbt change fork in run := true to fork in run := false
I'm trying to register a percolator query with the elastic4s library. After much research I've found I need to use something like:
val myQuery = """ { "query" : { "match" : { "foo" : "bar" } } } """
esClient.execute( register id 12345 into "baz" query myQuery )
As if I'm doing this:
curl -XPUT 'localhost:9200/baz/.percolator/12345' -d '{
"query" : {
"match" : {
"foo" : "bar"
}
}
}'
But whenever I try running esClient.execute I end up getting a few parsing errors, but it works fine through the curl:
[info] org.elasticsearch.index.percolator.PercolatorException: failed to parse query [987654]
[info] at org.elasticsearch.index.percolator.PercolatorQueriesRegistry.parsePercolatorDocument(PercolatorQueriesRegistry.java:182)
[info] at org.elasticsearch.index.percolator.PercolatorQueriesRegistry$RealTimePercolatorOperationListener.preIndex(PercolatorQueriesRegistry.java:301)
[info] at org.elasticsearch.index.indexing.ShardIndexingService.preIndex(ShardIndexingService.java:146)
[info] at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:565)
[info] at org.elasticsearch.index.engine.Engine$Index.execute(Engine.java:836)
[info] at org.elasticsearch.action.support.replication.TransportReplicationAction.executeIndexRequestOnPrimary(TransportReplicationAction.java:1073)
[info] at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:170)
[info] at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryPhase.performOnPrimary(TransportReplicationAction.java:579)
[info] at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryPhase$1.doRun(TransportReplicationAction.java:452)
[info] at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
[info] ...
[info] Cause: org.elasticsearch.index.query.QueryParsingException: Failed to parse query [{"query":{"match":{"foo":"bar"}}}]
[info] at org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:243)
[info] at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:257)
[info] at org.elasticsearch.index.query.IndexQueryParserService.parseInnerQuery(IndexQueryParserService.java:244)
[info] at org.elasticsearch.index.percolator.PercolatorQueriesRegistry.parseQuery(PercolatorQueriesRegistry.java:208)
[info] at org.elasticsearch.index.percolator.PercolatorQueriesRegistry.parsePercolatorDocument(PercolatorQueriesRegistry.java:179)
[info] at org.elasticsearch.index.percolator.PercolatorQueriesRegistry$RealTimePercolatorOperationListener.preIndex(PercolatorQueriesRegistry.java:301)
[info] at org.elasticsearch.index.indexing.ShardIndexingService.preIndex(ShardIndexingService.java:146)
[info] at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:565)
[info] at org.elasticsearch.index.engine.Engine$Index.execute(Engine.java:836)
[info] at org.elasticsearch.action.support.replication.TransportReplicationAction.executeIndexRequestOnPrimary(TransportReplicationAction.java:1073)
[info] ...
[info] Cause: org.apache.lucene.queryparser.classic.ParseException: Cannot parse '{"query":{"match":{"foo":"bar"}}}': Encountered " "}" "} "" at line 1, column 30.
[info] Was expecting one of:
[info] "TO" ...
[info] <RANGE_QUOTED> ...
[info] <RANGE_GOOP> ...
[info] at org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:123)
[info] at org.apache.lucene.queryparser.classic.MapperQueryParser.parse(MapperQueryParser.java:848)
[info] at org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:227)
[info] at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:257)
[info] at org.elasticsearch.index.query.IndexQueryParserService.parseInnerQuery(IndexQueryParserService.java:244)
[info] at org.elasticsearch.index.percolator.PercolatorQueriesRegistry.parseQuery(PercolatorQueriesRegistry.java:208)
[info] at org.elasticsearch.index.percolator.PercolatorQueriesRegistry.parsePercolatorDocument(PercolatorQueriesRegistry.java:179)
[info] at org.elasticsearch.index.percolator.PercolatorQueriesRegistry$RealTimePercolatorOperationListener.preIndex(PercolatorQueriesRegistry.java:301)
[info] at org.elasticsearch.index.indexing.ShardIndexingService.preIndex(ShardIndexingService.java:146)
[info] at org.elasticsearch.index.shard.IndexShard.index(IndexShard.java:565)
[info] ...
[info] Cause: org.apache.lucene.queryparser.classic.ParseException: Encountered " "}" "} "" at line 1, column 30.
[info] Was expecting one of:
[info] "TO" ...
[info] <RANGE_QUOTED> ...
[info] <RANGE_GOOP> ...
[info] at org.apache.lucene.queryparser.classic.QueryParser.generateParseException(QueryParser.java:698)
[info] at org.apache.lucene.queryparser.classic.QueryParser.jj_consume_token(QueryParser.java:580)
[info] at org.apache.lucene.queryparser.classic.QueryParser.Term(QueryParser.java:394)
[info] at org.apache.lucene.queryparser.classic.QueryParser.Clause(QueryParser.java:247)
[info] at org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:171)
[info] at org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:160)
[info] at org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:118)
[info] at org.apache.lucene.queryparser.classic.MapperQueryParser.parse(MapperQueryParser.java:848)
[info] at org.elasticsearch.index.query.QueryStringQueryParser.parse(QueryStringQueryParser.java:227)
[info] at org.elasticsearch.index.query.QueryParseContext.parseInnerQuery(QueryParseContext.java:257)
[info] ...
So I've got the feeling that I need to format the query differently, but it's not in the docs and I can't seem to find any examples out there. I've tried a few other formats like so:
val myQuery2 = """ "query" : { "match" : { "foo" : "bar" } } """
val myQuery3 = """ { "match" : { "foo" : "bar" } } """
val myQuery4 = """ "match" : { "foo" : "bar" } """
But nothing seems to be able to work, the only thing I've gotten to work was just having it like:
val myQuery5 = "query"
But with this I cannot specify what I actually want to match on. Anyone have any experience with this, or any ideas?
The query method accepts a string, but the string is a query string and not a json fragment as you have tried. If the query string format is not suitable, then you need to create the query using the elastic4s query dsl, eg
termQuery("field", "value")
or
matchQuery("field", "value")
etc. There are many query types, and they can be nested with a bool query.
I am trying to build multi-project and this is what my code looks like
import sbt._
import Keys._
object ProjectBuild extends Build {
lazy val commonSettings = Seq(
organization := "com.learner",
version := "0.1.0",
scalaVersion := "2.11.7",
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-actor" % "2.3.14",
"com.typesafe.akka" %% "akka-cluster" % "2.3.14"
)
)
lazy val cluster_simple = project
.settings(commonSettings: _*)
}
when I run SBT I get error as
> reload
[info] Loading project definition from /Users/harit/IdeaProjects/libs/akka-cluster-investigation/project
compile
[info] Set current project to akka-cluster-investigation (in build file:/Users/harit/IdeaProjects/libs/akka-cluster-investigation/)
> compile
[info] Updating {file:/Users/harit/IdeaProjects/libs/akka-cluster-investigation/}cluster_simple...
[info] Updating {file:/Users/harit/IdeaProjects/libs/akka-cluster-investigation/}akka-cluster-investigation...
[info] Resolving jline#jline;2.12.1 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.typesafe.akka#akka-actor_2.11;2.3.14: configuration not found in com.typesafe.akka#akka-actor_2.11;2.3.14: 'master(compile)'. Missing configuration: 'compile'. It was required from com.typesafe.akka#akka-remote_2.11;2.3.14 compile
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Unresolved dependencies path:
[warn] com.typesafe.akka:akka-actor_2.11:2.3.14 (/Users/harit/IdeaProjects/libs/akka-cluster-investigation/project/ProjectBuild.scala#L10)
[warn] +- com.typesafe.akka:akka-remote_2.11:2.3.14
[warn] +- com.typesafe.akka:akka-cluster_2.11:2.3.14 (/Users/harit/IdeaProjects/libs/akka-cluster-investigation/project/ProjectBuild.scala#L10)
[warn] +- com.learner:cluster_simple_2.11:0.1.0
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[trace] Stack trace suppressed: run last cluster_simple/*:update for the full output.
[error] (cluster_simple/*:update) sbt.ResolveException: unresolved dependency: com.typesafe.akka#akka-actor_2.11;2.3.14: configuration not found in com.typesafe.akka#akka-actor_2.11;2.3.14: 'master(compile)'. Missing configuration: 'compile'. It was required from com.typesafe.akka#akka-remote_2.11;2.3.14 compile
[error] Total time: 0 s, completed Oct 17, 2015 12:41:00 PM
>
What am I missing?
I removed the ~/.ivy2 folder and ran again
$ sbt clean compile
[info] Loading project definition from /Users/harit/IdeaProjects/libs/akka-cluster-investigation/project
[info] Set current project to akka-cluster-investigation (in build file:/Users/harit/IdeaProjects/libs/akka-cluster-investigation/)
[success] Total time: 0 s, completed Oct 17, 2015 6:45:10 PM
[info] Updating {file:/Users/harit/IdeaProjects/libs/akka-cluster-investigation/}akka-cluster-investigation...
[info] Updating {file:/Users/harit/IdeaProjects/libs/akka-cluster-investigation/}cluster_simple...
[info] Resolving org.sonatype.oss#oss-parent;7 ...
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.7/scala-library-2.11.7.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.11.7!scala-library.jar (1958ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.7/scala-compiler-2.11.7.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.11.7!scala-compiler.jar (11051ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.7/scala-reflect-2.11.7.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.7!scala-reflect.jar (3520ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.4/scala-xml_2.11-1.0.4.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.4!scala-xml_2.11.jar(bundle) (634ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.4/scala-parser-combinators_2.11-1.0.4.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-parser-combinators_2.11;1.0.4!scala-parser-combinators_2.11.jar(bundle) (455ms)
[info] downloading https://repo1.maven.org/maven2/jline/jline/2.12.1/jline-2.12.1.jar ...
[info] [SUCCESSFUL ] jline#jline;2.12.1!jline.jar (333ms)
[info] Done updating.
[info] Resolving jline#jline;2.12.1 ...
[info] downloading https://repo1.maven.org/maven2/com/typesafe/akka/akka-actor_2.11/2.3.14/akka-actor_2.11-2.3.14.jar ...
[info] [SUCCESSFUL ] com.typesafe.akka#akka-actor_2.11;2.3.14!akka-actor_2.11.jar (3241ms)
[info] downloading https://repo1.maven.org/maven2/com/typesafe/akka/akka-cluster_2.11/2.3.14/akka-cluster_2.11-2.3.14.jar ...
[info] [SUCCESSFUL ] com.typesafe.akka#akka-cluster_2.11;2.3.14!akka-cluster_2.11.jar (930ms)
[info] downloading https://repo1.maven.org/maven2/com/typesafe/config/1.2.1/config-1.2.1.jar ...
[info] [SUCCESSFUL ] com.typesafe#config;1.2.1!config.jar(bundle) (267ms)
[info] downloading https://repo1.maven.org/maven2/com/typesafe/akka/akka-remote_2.11/2.3.14/akka-remote_2.11-2.3.14.jar ...
[info] [SUCCESSFUL ] com.typesafe.akka#akka-remote_2.11;2.3.14!akka-remote_2.11.jar (1571ms)
[info] downloading https://repo1.maven.org/maven2/io/netty/netty/3.8.0.Final/netty-3.8.0.Final.jar ...
[info] [SUCCESSFUL ] io.netty#netty;3.8.0.Final!netty.jar(bundle) (1249ms)
[info] downloading https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar ...
[info] [SUCCESSFUL ] com.google.protobuf#protobuf-java;2.5.0!protobuf-java.jar(bundle) (542ms)
[info] downloading https://repo1.maven.org/maven2/org/uncommons/maths/uncommons-maths/1.2.2a/uncommons-maths-1.2.2a.jar ...
[info] [SUCCESSFUL ] org.uncommons.maths#uncommons-maths;1.2.2a!uncommons-maths.jar (140ms)
[info] Done updating.
[success] Total time: 30 s, completed Oct 17, 2015 6:45:40 PM
Some of my tests require that they are sequentially executed. I read about custom configurations on http://www.scala-sbt.org/0.13.0/docs/Detailed-Topics/Testing.html but I am missing something because my configuration is not working properly.
Here it is:
import sbt._
import Keys._
object SchedulingBackendBuild extends Build {
lazy val SequentialTest = config("sequentialTest") extend(Test)
def sequentialTestFilter(name: String): Boolean = {
println("===seq test filter")
name endsWith "SeqSpec"
}
def unitTestFilter(name: String): Boolean = {
println("===unit test filter")
!sequentialTestFilter(name)
}
lazy val root = Project(id = "scheduling-backend",
base = file("."),
settings = Project.defaultSettings
).configs(SequentialTest)
.settings(inConfig(SequentialTest)(Defaults.testTasks): _*)
.settings(
testOptions in Test ++= Seq(Tests.Filter(unitTestFilter)),
testOptions in SequentialTest ++= Seq(Tests.Filter(sequentialTestFilter))
)
}
I want test to only execute tests that are not ending with SeqSpec and this is working, but when I try to execute sequentialTest:test no tests are executed. I added println to my filters and I can see that even if I execute sequentialTest:test I am getting
===unit test filter
===seq test filter
===seq test filter
so both filters are executed.
When I type inspect sequentialTest:testOptions I am getting
[info] Task: scala.collection.Seq[sbt.TestOption]
[info] Description:
[info] Options for running tests.
[info] Provided by:
[info] {file:/path/to/project/scheduling-backend/}scheduling-backend/sequentialTest:testOptions
[info] Defined at:
[info] /path/to/project/scheduling-backend/project/Build.scala:22
[info] Reverse dependencies:
[info] sequentialTest:testOnly::testOptions
[info] sequentialTest:testQuick::testOptions
[info] sequentialTest:test::testOptions
[info] Delegates:
[info] sequentialTest:testOptions
[info] test:testOptions
[info] runtime:testOptions
[info] compile:testOptions
[info] *:testOptions
[info] {.}/sequentialTest:testOptions
[info] {.}/test:testOptions
[info] {.}/runtime:testOptions
[info] {.}/compile:testOptions
[info] {.}/*:testOptions
[info] */sequentialTest:testOptions
[info] */test:testOptions
[info] */runtime:testOptions
[info] */compile:testOptions
[info] */*:testOptions
[info] Related:
[info] sequentialTest:testOnly::testOptions
[info] sequentialTest:testQuick::testOptions
[info] test:testOptions
[info] test:testQuick::testOptions
[info] */*:testOptions
[info] test:testOnly::testOptions
[info] test:test::testOptions
[info] sequentialTest:test::testOptions
so for me it looks ok, line 22 is testOptions in SequentialTest ++= Seq(Tests.Filter(sequentialTestFilter))
Partial answer: if I change ++= operator (appending to the sequence) to := (replacing the sequence) everything works fine (and := operators are used in the documentation). Even so I would want to know why ++= in this case is bad choice.
sbt 0.12.4 on Windows.
Firstly, I move into the project directory, that is example - a Scala project under sbt. When I run sbt, I get the following errors:
C:\programs\example>sbt
[info] Loading project definition from C:\programs\example\project\project
[info] Updating {file:/C:/programs/example/project/project/}default-2ad7de...
[info] Resolving org.scala-sbt#sbt;0.12.4 ...
[info] Resolving org.scala-sbt#main;0.12.4 ...
[info] Resolving org.scala-sbt#actions;0.12.4 ...
[info] Resolving org.scala-sbt#classpath;0.12.4 ...
[info] Resolving org.scala-sbt#launcher-interface;0.12.4 ...
[info] Resolving org.scala-lang#scala-library;2.9.2 ...
[info] Resolving org.scala-sbt#interface;0.12.4 ...
[info] Resolving org.scala-sbt#io;0.12.4 ...
[info] Resolving org.scala-sbt#control;0.12.4 ...
[info] Resolving org.scala-lang#scala-compiler;2.9.2 ...
[info] Resolving org.scala-sbt#completion;0.12.4 ...
[info] Resolving org.scala-sbt#collections;0.12.4 ...
[info] Resolving jline#jline;1.0 ...
[info] Resolving org.scala-sbt#api;0.12.4 ...
[info] Resolving org.scala-sbt#compiler-integration;0.12.4 ...
[info] Resolving org.scala-sbt#incremental-compiler;0.12.4 ...
[info] Resolving org.scala-sbt#logging;0.12.4 ...
[info] Resolving org.scala-sbt#process;0.12.4 ...
[info] Resolving org.scala-sbt#compile;0.12.4 ...
[info] Resolving org.scala-sbt#persist;0.12.4 ...
[info] Resolving org.scala-tools.sbinary#sbinary_2.9.0;0.4.0 ...
[info] Resolving org.scala-sbt#classfile;0.12.4 ...
[info] Resolving org.scala-sbt#compiler-ivy-integration;0.12.4 ...
[info] Resolving org.scala-sbt#ivy;0.12.4 ...
[info] Resolving org.apache.ivy#ivy;2.3.0-rc1 ...
[info] Resolving com.jcraft#jsch;0.1.46 ...
[info] Resolving commons-httpclient#commons-httpclient;3.1 ...
[info] Resolving commons-logging#commons-logging;1.0.4 ...
[info] Resolving commons-codec#commons-codec;1.2 ...
[info] Resolving org.scala-sbt#run;0.12.4 ...
[info] Resolving org.scala-sbt#task-system;0.12.4 ...
[info] Resolving org.scala-sbt#tasks;0.12.4 ...
[info] Resolving org.scala-sbt#tracking;0.12.4 ...
[info] Resolving org.scala-sbt#cache;0.12.4 ...
[info] Resolving org.scala-sbt#testing;0.12.4 ...
[info] Resolving org.scala-sbt#test-agent;0.12.4 ...
[info] Resolving org.scala-tools.testing#test-interface;0.5 ...
[info] Resolving org.scala-sbt#command;0.12.4 ...
[info] Resolving org.scala-sbt#compiler-interface;0.12.4 ...
[info] Resolving org.scala-sbt#precompiled-2_8_2;0.12.4 ...
[info] Resolving org.scala-sbt#precompiled-2_9_3;0.12.4 ...
[info] Resolving org.scala-sbt#precompiled-2_10_1;0.12.4 ...
[info] Done updating.
[info] Loading project definition from C:\programs\example\project
[info] Updating {file:/C:/programs/example/project/}default-116b7c...
[info] Resolving net.databinder#dispatch-http_2.9.2;0.8.8 ...
[info] Resolving net.databinder#dispatch-core_2.9.2;0.8.8 ...
[info] Resolving org.scala-lang#scala-library;2.9.2 ...
[info] Resolving org.apache.httpcomponents#httpclient;4.1.3 ...
[info] Resolving org.apache.httpcomponents#httpcore;4.1.4 ...
[info] Resolving commons-logging#commons-logging;1.1.1 ...
[info] Resolving commons-codec#commons-codec;1.4 ...
[info] Resolving net.databinder#dispatch-futures_2.9.2;0.8.8 ...
//some mor like the above
[info] Done updating.
[info] Compiling 8 Scala sources to C:\programs\example\project\target\scala-2.9
.2\sbt-0.12\classes...
[error] C:\programs\example\project\ProgFunBuild.scala:190: object Test is not a
value
[error] (argTask, currentProject, baseDirectory, handoutFiles, submitProject
Name, target, projectDetailsMap, compile in Test) map { (args, currentProject, b
asedir, filesFinder, submitProject, targetDir, detailsMap, _) =>
[error]
^
[error] C:\programs\example\project\ProgFunBuild.scala:56: object Test is not a
value
[error] (unmanagedSourceDirectories in Test) <<= (scalaSource in Test)(Seq(_
)),
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:265: object Test is not a
value
[error] (unmanagedSources in Test) <<= (unmanagedSources in Test, scalaSourc
e in Test, projectDetailsMap, currentProject, gradingTestPackages) map { (source
s, srcTestScalaDir, detailsMap, projectName, gradingSrcs) =>
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:265: reassignment to val
[error] (unmanagedSources in Test) <<= (unmanagedSources in Test, scalaSourc
e in Test, projectDetailsMap, currentProject, gradingTestPackages) map { (source
s, srcTestScalaDir, detailsMap, projectName, gradingSrcs) =>
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:288: object Test is not a
value
[error] val setTestPropertiesHook = (test in Test) <<= (test in Test).dependsO
n(setTestProperties)
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:288: reassignment to val
[error] val setTestPropertiesHook = (test in Test) <<= (test in Test).dependsO
n(setTestProperties)
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:304: object Test is not a
value
[error] compile in Test,
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:512: object Test is not a
value
[error] val readTestCompileLog = (compile in Test) <<= (compile in Test) mapR
handleFailure(compileTestFailed)
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:512: reassignment to val
[error] val readTestCompileLog = (compile in Test) <<= (compile in Test) mapR
handleFailure(compileTestFailed)
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:553: object Test is not a
value
[error] (sourceDirectory in Test) <<= (sourceDirectory in (assignmentProject
, Test))
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:553: reassignment to val
[error] (sourceDirectory in Test) <<= (sourceDirectory in (assignmentProject
, Test))
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:561: object Test is not a
value
[error] (unmanagedSources in Test) <<= (unmanagedSources in Test, scalaSourc
e in (assignmentProject, Test), gradingTestPackages in assignmentProject, gradeP
rojectDetails) map { (sources, testSrcScalaDir, gradingSrcs, project) =>
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:561: reassignment to val
[error] (unmanagedSources in Test) <<= (unmanagedSources in Test, scalaSourc
e in (assignmentProject, Test), gradingTestPackages in assignmentProject, gradeP
rojectDetails) map { (sources, testSrcScalaDir, gradingSrcs, project) =>
[error] ^
[error] C:\programs\example\project\ProgFunBuild.scala:570: object Test is not a
value
[error] compile in Test,
[error] ^
[error] 14 errors found
[error] (compile:compile) Compilation failed
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
UPDATE
When I press l at the commmand prompt, the error log is as follows:
[info] Loading project definition from C:\A\example\project\project
[debug] Running task... Cancelable: false, check cycles: false
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set()
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set()
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated sources: Set()
[debug] Copy resource mappings:
[debug]
[info] Loading project definition from C:\A\example\project
[debug] Running task... Cancelable: false, check cycles: false
[debug]
[debug] Initial source changes:
[debug] removed:Set()
[debug] added: Set(C:\A\example\project\Settings.scala, C:\A\example\pro
ject\StyleChecker.scala, C:\A\example\project\GradingFeedback.scala, C:\A\exampl
e\project\CourseraHttp.scala, C:\A\example\project\ProgFunBuild.scala, C:\A\exam
ple\project\ScalaTestRunner.scala, C:\A\example\project\RichJsValue.scala, C:\A\
example\project\RecordingLogger.scala)
[debug] modified: Set()
[debug] Removed products: Set()
[debug] Modified external sources: Set()
[debug] Modified binary dependencies: Set()
[debug] Initial directly invalidated sources: Set(C:\A\example\project\Settings.
scala, C:\A\example\project\StyleChecker.scala, C:\A\example\project\GradingFeed
back.scala, C:\A\example\project\CourseraHttp.scala, C:\A\example\project\ProgFu
nBuild.scala, C:\A\example\project\ScalaTestRunner.scala, C:\A\example\project\R
ichJsValue.scala, C:\A\example\project\RecordingLogger.scala)
[debug]
[debug] Sources indirectly invalidated by:
[debug] product: Set()
[debug] binary dep: Set()
[debug] external source: Set()
[debug] All initially invalidated sources: Set(C:\A\example\project\Settings.sca
la, C:\A\example\project\StyleChecker.scala, C:\A\example\project\GradingFeedbac
k.scala, C:\A\example\project\CourseraHttp.scala, C:\A\example\project\ProgFunBu
ild.scala, C:\A\example\project\ScalaTestRunner.scala, C:\A\example\project\Rich
JsValue.scala, C:\A\example\project\RecordingLogger.scala)
[debug] Recompiling all 8 sources: invalidated sources (8) exceeded 50.0% of all
sources
[info] Compiling 8 Scala sources to C:\A\example\project\target\scala-2.9.2\sbt-
0.12\classes...
[debug] Getting compiler-interface from component compiler for Scala 2.9.2
[debug] Getting compiler-interface from component compiler for Scala 2.9.2
[debug] Running cached compiler b206e9, interfacing (CompilerInterface) with Sca
la compiler version 2.9.2
[debug] Calling Scala compiler with arguments (CompilerInterface):
[debug] -deprecation
[debug] -d
[debug] C:\A\example\project\target\scala-2.9.2\sbt-0.12\classes
[debug] -bootclasspath
[debug] C:\Program Files\Java\jre6\lib\resources.jar;C:\Program Files\Ja
va\jre6\lib\rt.jar;C:\Program Files\Java\jre6\lib\sunrsasign.jar;C:\Program File
s\Java\jre6\lib\jsse.jar;C:\Program Files\Java\jre6\lib\jce.jar;C:\Program Files
\Java\jre6\lib\charsets.jar;C:\Program Files\Java\jre6\lib\modules\jdk.boot.jar;
C:\Program Files\Java\jre6\classes;C:\Documents and Settings\User\.sbt\boot\scal
a-2.9.2\lib\scala-library.jar
[debug] -classpath
[debug] C:\A\example\project\target\scala-2.9.2\sbt-0.12\classes;C:\Docu
ments and Settings\User\.ivy2\cache\net.databinder\dispatch-http_2.9.2\jars\disp
atch-http_2.9.2-0.8.8.jar;C:\Documents and Settings\User\.ivy2\cache\net.databin
der\dispatch-core_2.9.2\jars\dispatch-core_2.9.2-0.8.8.jar;C:\Documents and Sett
ings\User\.ivy2\cache\org.apache.httpcomponents\httpclient\jars\httpclient-4.1.3
.jar;C:\Documents and Settings\User\.ivy2\cache\org.apache.httpcomponents\httpco
re\jars\httpcore-4.1.4.jar;C:\Documents and Settings\User\.ivy2\cache\commons-lo
gging\commons-logging\jars\commons-logging-1.1.1.jar;C:\Documents and Settings\U
ser\.ivy2\cache\commons-codec\commons-codec\jars\commons-codec-1.4.jar;C:\Docume
nts and Settings\User\.ivy2\cache\net.databinder\dispatch-futures_2.9.2\jars\dis
patch-futures_2.9.2-0.8.8.jar;C:\Documents and Settings\User\.ivy2\cache\org.sca
lastyle\scalastyle_2.9.1\jars\scalastyle_2.9.1-0.1.3-SNAPSHOT.jar;C:\Documents a
nd Settings\User\.ivy2\cache\org.scalariform\scalariform_2.9.1\jars\scalariform_
2.9.1-0.1.1.jar;C:\Documents and Settings\User\.ivy2\cache\com.github.scopt\scop
t_2.9.1\jars\scopt_2.9.1-2.0.0.jar;C:\Documents and Settings\User\.ivy2\cache\cc
.spray\spray-json_2.9.2\jars\spray-json_2.9.2-1.1.1.jar;C:\Documents and Setting
s\User\.ivy2\cache\org.parboiled\parboiled-scala\jars\parboiled-scala-1.0.2.jar;
C:\Documents and Settings\User\.ivy2\cache\org.parboiled\parboiled-core\jars\par
boiled-core-1.0.2.jar;C:\Documents and Settings\User\.ivy2\cache\org.scalatest\s
calatest_2.9.2\jars\scalatest_2.9.2-1.9.1.jar;C:\Documents and Settings\User\.iv
y2\cache\org.apache.commons\commons-lang3\jars\commons-lang3-3.1.jar;C:\Document
s and Settings\User\.ivy2\cache\scala_2.9.2\sbt_0.12\com.typesafe.sbteclipse\sbt
eclipse-plugin\jars\sbteclipse-plugin-2.1.0.jar;C:\Documents and Settings\User\.
ivy2\cache\scala_2.9.2\sbt_0.12\com.typesafe.sbteclipse\sbteclipse-core\jars\sbt
eclipse-core-2.1.0.jar;C:\Documents and Settings\User\.ivy2\cache\org.scalaz\sca
laz-core_2.9.2\jars\scalaz-core_2.9.2-6.0.4.jar;C:\Documents and Settings\User\.
ivy2\cache\org.scala-sbt\sbt\jars\sbt-0.12.4.jar;C:\Documents and Settings\User\
.ivy2\cache\org.scala-sbt\main\jars\main-0.12.4.jar;C:\Documents and Settings\Us
er\.ivy2\cache\org.scala-sbt\actions\jars\actions-0.12.4.jar;C:\Documents and Se
ttings\User\.ivy2\cache\org.scala-sbt\classpath\jars\classpath-0.12.4.jar;C:\Doc
uments and Settings\User\.ivy2\cache\org.scala-sbt\launcher-interface\jars\launc
her-interface-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\org.scala-sb
t\interface\jars\interface-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache
\org.scala-sbt\io\jars\io-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\
org.scala-sbt\control\jars\control-0.12.4.jar;C:\Documents and Settings\User\.sb
t\boot\scala-2.9.2\lib\scala-compiler.jar;C:\Documents and Settings\User\.ivy2\c
ache\org.scala-sbt\completion\jars\completion-0.12.4.jar;C:\Documents and Settin
gs\User\.ivy2\cache\org.scala-sbt\collections\jars\collections-0.12.4.jar;C:\Doc
uments and Settings\User\.ivy2\cache\jline\jline\jars\jline-1.0.jar;C:\Documents
and Settings\User\.ivy2\cache\org.scala-sbt\api\jars\api-0.12.4.jar;C:\Document
s and Settings\User\.ivy2\cache\org.scala-sbt\compiler-integration\jars\compiler
-integration-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\org.scala-sbt
\incremental-compiler\jars\incremental-compiler-0.12.4.jar;C:\Documents and Sett
ings\User\.ivy2\cache\org.scala-sbt\logging\jars\logging-0.12.4.jar;C:\Documents
and Settings\User\.ivy2\cache\org.scala-sbt\process\jars\process-0.12.4.jar;C:\
Documents and Settings\User\.ivy2\cache\org.scala-sbt\compile\jars\compile-0.12.
4.jar;C:\Documents and Settings\User\.ivy2\cache\org.scala-sbt\persist\jars\pers
ist-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\org.scala-tools.sbinar
y\sbinary_2.9.0\jars\sbinary_2.9.0-0.4.0.jar;C:\Documents and Settings\User\.ivy
2\cache\org.scala-sbt\classfile\jars\classfile-0.12.4.jar;C:\Documents and Setti
ngs\User\.ivy2\cache\org.scala-sbt\compiler-ivy-integration\jars\compiler-ivy-in
tegration-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\org.scala-sbt\iv
y\jars\ivy-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\org.apache.ivy\
ivy\jars\ivy-2.3.0-rc1.jar;C:\Documents and Settings\User\.ivy2\cache\com.jcraft
\jsch\jars\jsch-0.1.46.jar;C:\Documents and Settings\User\.ivy2\cache\commons-ht
tpclient\commons-httpclient\jars\commons-httpclient-3.1.jar;C:\Documents and Set
tings\User\.ivy2\cache\org.scala-sbt\run\jars\run-0.12.4.jar;C:\Documents and Se
ttings\User\.ivy2\cache\org.scala-sbt\task-system\jars\task-system-0.12.4.jar;C:
\Documents and Settings\User\.ivy2\cache\org.scala-sbt\tasks\jars\tasks-0.12.4.j
ar;C:\Documents and Settings\User\.ivy2\cache\org.scala-sbt\tracking\jars\tracki
ng-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\org.scala-sbt\cache\jar
s\cache-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\org.scala-sbt\test
ing\jars\testing-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\org.scala
-sbt\test-agent\jars\test-agent-0.12.4.jar;C:\Documents and Settings\User\.ivy2\
cache\org.scala-tools.testing\test-interface\jars\test-interface-0.5.jar;C:\Docu
ments and Settings\User\.ivy2\cache\org.scala-sbt\command\jars\command-0.12.4.ja
r;C:\Documents and Settings\User\.ivy2\cache\org.scala-sbt\compiler-interface\ja
rs\compiler-interface-bin-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\
org.scala-sbt\compiler-interface\jars\compiler-interface-src-0.12.4.jar;C:\Docum
ents and Settings\User\.ivy2\cache\org.scala-sbt\precompiled-2_8_2\jars\compiler
-interface-bin-0.12.4.jar;C:\Documents and Settings\User\.ivy2\cache\org.scala-s
bt\precompiled-2_9_3\jars\compiler-interface-bin-0.12.4.jar;C:\Documents and Set
tings\User\.ivy2\cache\org.scala-sbt\precompiled-2_10_1\jars\compiler-interface-
bin-0.12.4.jar
A pragmatic "solution" that may help to get you running for now: replace all those occurrences of in Test in ProgFunBuild.scala with in sbt.Test and then try again.
Still, something is broken in your environment.
What happens when you run sbt is that it is not compiling your sources but the build definition of sbt. The problem seems to be that Test is not found. I can only vaguely speculate...
Did you touch that file ProgFunBuild in any way?
Did you accidentally place your normal source code in the project sub directory? Perhaps you did that and have an object Test defined in there which shadows sbt's Test scope?
From what directory do you run sbt? You should be in the root folder of the example, not inside the project directory.
You should have the following layout:
project/ProgFunBuild.scala
project/build.properties (optional)
build.sbt (optional)
src/main/scala/... (your sources in there)