我运行了typesafe激活器示例play-slick

时间:2013-12-24 05:51:08

标签: playframework-2.0 sbt slick typesafe-activator

我运行typesafe激活器示例play-slick

https://www.typesafe.com/activator/template/play-slick

但是我用sbt而不是activator命令编译它。 即使我删除了视图中的所有javascript,仍然存在错误。

错误如下:

当我运行它时,它会给我错误:

   ! @6gkhpk9fi - Internal server error, for (GET) [/] ->

    play.PlayExceptions$AssetCompilationException: Compilation error[Internal Closur
e Compiler error (see logs)]
        at play.core.jscompile.JavascriptCompiler$.compile(JavascriptCompiler.sc
ala:63) ~[na:na]
        at play.PlayAssetsCompiler$$anonfun$JavascriptCompiler$3.apply(PlayAsset
sCompiler.scala:96) ~[na:na]
        at play.PlayAssetsCompiler$$anonfun$JavascriptCompiler$3.apply(PlayAsset
sCompiler.scala:96) ~[na:na]
        at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1$$anonfun$3.liftedTr
ee1$1(PlayAssetsCompiler.scala:52) ~[na:na]
        at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1$$anonfun$3.apply(Pl
ayAssetsCompiler.scala:51) ~[na:na]
        at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1$$anonfun$3.apply(Pl
ayAssetsCompiler.scala:48) ~[na:na]
java.lang.RuntimeException: java.lang.RuntimeException: com.google.javascript.js
comp.deps.SortedDependencies$MissingProvideException: module$index
        at com.google.javascript.jscomp.Compiler.runInCompilerThread(Compiler.ja
va:715)
        at com.google.javascript.jscomp.Compiler.compile(Compiler.java:647)
        at com.google.javascript.jscomp.Compiler.compile(Compiler.java:603)
        at com.google.javascript.jscomp.Compiler.compile(Compiler.java:585)
        at play.core.jscompile.JavascriptCompiler$$anonfun$1.apply$mcZ$sp(Javasc
riptCompiler.scala:54)
        at play.core.jscompile.JavascriptCompiler$$anonfun$1.apply(JavascriptCom
piler.scala:54)
        at play.core.jscompile.JavascriptCompiler$$anonfun$1.apply(JavascriptCom
piler.scala:54)
        at scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.
scala:124)
        at scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.
scala:124)
        at scala.util.control.Exception$Catch.apply(Exception.scala:102)
        at scala.util.control.Exception$Catch.either(Exception.scala:124)
        at play.core.jscompile.JavascriptCompiler$.compile(JavascriptCompiler.sc
ala:54)
        at play.PlayAssetsCompiler$$anonfun$JavascriptCompiler$3.apply(PlayAsset
sCompiler.scala:96)
        at play.PlayAssetsCompiler$$anonfun$JavascriptCompiler$3.apply(PlayAsset
sCompiler.scala:96)
        at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1$$anonfun$3.liftedTr
ee1$1(PlayAssetsCompiler.scala:52)
        at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1$$anonfun$3.apply(Pl
ayAssetsCompiler.scala:51)
        at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1$$anonfun$3.apply(Pl
ayAssetsCompiler.scala:48)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(Traversable
Like.scala:251)
        at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(Traversable
Like.scala:251)
        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.
scala:59)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
        at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:
251)
        at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
        at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1.apply(PlayAssetsCom
piler.scala:48)
        at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1.apply(PlayAssetsCom
piler.scala:21)
        at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:35)
        at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:34)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
        at sbt.std.Transform$$anon$4.work(System.scala:64)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:23
7)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:23
7)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
        at sbt.Execute.work(Execute.scala:244)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestric
tions.scala:160)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:47
1)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: com.google.javascript.jscomp.deps.SortedD
ependencies$MissingProvideException: module$index
        at com.google.common.base.Throwables.propagate(Throwables.java:160)
        at com.google.javascript.jscomp.Compiler.processAMDAndCommonJSModules(Co
mpiler.java:1560)
        at com.google.javascript.jscomp.Compiler.parseInputs(Compiler.java:1336)

        at com.google.javascript.jscomp.Compiler.parse(Compiler.java:764)
        at com.google.javascript.jscomp.Compiler.compileInternal(Compiler.java:7
23)
        at com.google.javascript.jscomp.Compiler.access$000(Compiler.java:83)
        at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:650)
        at com.google.javascript.jscomp.Compiler$2.call(Compiler.java:647)
        at com.google.javascript.jscomp.Compiler$3.call(Compiler.java:677)
        ... 4 more
    Caused by: com.google.javascript.jscomp.deps.SortedDependencies$MissingProvideEx
    ception: module$index
        at com.google.javascript.jscomp.deps.SortedDependencies.getInputProvidin
    g(SortedDependencies.java:120)
        at com.google.javascript.jscomp.JSModuleGraph.createEntryPointInputs(JSM
    oduleGraph.java:466)
        at com.google.javascript.jscomp.JSModuleGraph.manageDependencies(JSModul
    eGraph.java:375)
        at com.google.javascript.jscomp.Compiler.processAMDAndCommonJSModules(Co
    mpiler.java:1544)
        ... 11 more
    [error] C:\git\play-slick\app\assets\javascripts\index.js: Compilation error[Int
    ernal Closure Compiler error (see logs)]
    [error] (compile:managedResources) @6gkhpm6kn: Compilation error in C:\git\play-
    slick\app\assets\javascripts\index.js:null
    [error] application -

logs / application.log

 2013-12-24 21:18:05,638 - [ERROR] - from application in New I/O worker #1 


! @6gkjah3n7 - Internal server error, for (GET) [/] ->

play.PlayExceptions$AssetCompilationException: Compilation error[Internal Closure Compiler error (see logs)]
at play.core.jscompile.JavascriptCompiler$.compile(JavascriptCompiler.scala:63) ~[na:na]
at play.PlayAssetsCompiler$$anonfun$JavascriptCompiler$3.apply(PlayAssetsCompiler.scala:96) ~[na:na]
at play.PlayAssetsCompiler$$anonfun$JavascriptCompiler$3.apply(PlayAssetsCompiler.scala:96) ~[na:na]
at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1$$anonfun$3.liftedTree1$1(PlayAssetsCompiler.scala:52) ~[na:na]
at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1$$anonfun$3.apply(PlayAssetsCompiler.scala:51) ~[na:na]
at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1$$anonfun$3.apply(PlayAssetsCompiler.scala:48) ~[na:na]
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) ~[scala-library.jar:na]
at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251) ~[scala-library.jar:na]
at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) ~[scala-library.jar:na]
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47) ~[scala-library.jar:na]
at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251) ~[scala-library.jar:na]
at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105) ~[scala-library.jar:na]
at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1.apply(PlayAssetsCompiler.scala:48) ~[na:na]
at play.PlayAssetsCompiler$$anonfun$AssetsCompiler$1.apply(PlayAssetsCompiler.scala:21) ~[na:na]
at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:35) ~[scala-library.jar:na]
at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:34) ~[scala-library.jar:na]
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) ~[scala-library.jar:na]
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42) ~[na:na]
at sbt.std.Transform$$anon$4.work(System.scala:64) ~[na:na]
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237) ~[na:na]
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237) ~[na:na]
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18) ~[na:na]
at sbt.Execute.work(Execute.scala:244) ~[na:na]
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237) ~[na:na]
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237) ~[na:na]
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160) ~[na:na]
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30) ~[na:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_45]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) ~[na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]

2013-12-24 21:18:05,801 - [WARN] - from play in New I/O worker #1 
No application found at invoker init

根据詹姆斯的回答,我改变了plugins.sbt,但是我得到了播放错误2.2.1无法找到错误

[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/play/sbt-plugin_2.10_0.13/2.2.1/sbt-plugi
n-2.2.1.pom
[warn] ==== Typesafe repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.10_0.13/2.
2.1/sbt-plugin-2.2.1.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: play#sbt-plugin;2.2.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Some unresolved dependencies have extra attributes.  Check that th
ese dependencies exist with the requested attributes.
[warn]          play:sbt-plugin:2.2.1 (sbtVersion=0.13, scalaVersion=2.10)
[warn]

1 个答案:

答案 0 :(得分:2)

我认为这是Play 2.2.0中的一个错误(可能只在Windows上)。我将与作者合作,将模板更新为Play 2.2.1。在此期间,请尝试通过将project/plugins.sbt文件中的最后一行更改为:

来升级您的应用
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.1")

如果您使用的是Activator UI,请重新加载浏览器。