开始时播放框架错误

时间:2012-06-22 06:34:43

标签: java playframework playframework-2.0

第一次访问localhost:9000时出错。这是我的第一个'play run'命令。我是Play框架的新手,在浏览器中写道:编译失败而没有报告任何问题!?。

Controller`s代码是默认代码:

  public class Application extends Controller {

   public static Result index() {
             return ok(index.render("Your new application is ready."));
   }

}

播放2.0的版本。

我的日志文件中的stacktrace如下:

    2012-06-22 10:25:29,937 - [INFO] - from play in main 
    Listening for HTTP on port 9001...

    2012-06-22 10:25:43,292 - [ERROR] - from application in New I/O server worker #1-1 
    ! Internal server error, for request [GET /] ->
    play.api.UnexpectedException: Unexpected exception [Compilation failed without reporting any problem!?]
    at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11$$anonfun$apply$13.apply(PlayReloade  r.scala:225) ~[na:na]
    at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11$$anonfun$apply$13.apply(PlayReloade  r.scala:225) ~[na:na]
    at scala.Option.getOrElse(Option.scala:108) ~[scala-library.jar:0.11.2]
    at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11.apply(PlayReloader.scala:224) ~   [na:na]
    at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2$$anonfun$apply$11.apply(PlayReloader.scala:221) ~[na:na]
    at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.2]
    at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2.apply(PlayReloader.scala:221) ~[na:na]
    at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$2.apply(PlayReloader.scala:219) ~[na:na]
    at scala.Either$LeftProjection.map(Either.scala:183) ~[scala-library.jar:0.11.2]
    at sbt.PlayReloader$$anon$2$$anonfun$reload$3.apply(PlayReloader.scala:219) ~[na:na]
    at sbt.PlayReloader$$anon$2$$anonfun$reload$3.apply(PlayReloader.scala:214) ~[na:na]
    at scala.Option.getOrElse(Option.scala:108) ~[scala-library.jar:0.11.2]
    at sbt.PlayReloader$$anon$2.reload(PlayReloader.scala:214) ~[na:na]
    at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110) ~[play_2.9.1.jar:2.0]
    at play.core.ReloadableApplication$$anonfun$get$1.apply(ApplicationProvider.scala:110) ~[play_2.9.1.jar:2.0]
    at akka.dispatch.Future$$anon$3.liftedTree1$1(Future.scala:195) ~[akka-actor.jar:2.0]
    at akka.dispatch.Future$$anon$3.run(Future.scala:194) ~[akka-actor.jar:2.0]
    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:83) ~[akka-actor.jar:2.0]
    at akka.jsr166y.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1381) ~[akka-actor.jar:2.0]
    at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) ~[akka-actor.jar:2.0]
    at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:997) ~[akka-actor.jar:2.0]
    at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1495) ~[akka-actor.jar:2.0]
    at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) ~[akka-actor.jar:2.0]
sbt.compiler.CompileFailed: null
    at sbt.compiler.JavaCompiler$$anon$1.apply(JavaCompiler.scala:26) ~[na:na]
    at sbt.AggressiveCompile$$anonfun$5$$anonfun$compileJava$1$1.apply$mcV$sp(AggressiveCompile.scala:76) ~[na:na]
    at sbt.classfile.Analyze$.apply(Analyze.scala:93) ~[na:na]
    at sbt.AggressiveCompile$$anonfun$5.compileJava$1(AggressiveCompile.scala:75) ~[na:na]
    at sbt.AggressiveCompile$$anonfun$5.apply(AggressiveCompile.scala:79) ~[na:na]
    at sbt.AggressiveCompile$$anonfun$5.apply(AggressiveCompile.scala:57) ~[na:na]
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:21) ~[na:na]
    at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:19) ~[na:na]
    at sbt.inc.Incremental$.cycle(Incremental.scala:33) ~[na:na]
    at sbt.inc.Incremental$.compile(Incremental.scala:20) ~[na:na]
    at sbt.inc.IncrementalCompile$.apply(Compile.scala:17) ~[na:na]
    at sbt.AggressiveCompile.compile2(AggressiveCompile.scala:87) ~[na:na]
    at sbt.AggressiveCompile.compile1(AggressiveCompile.scala:41) ~[na:na]
    at sbt.AggressiveCompile.apply(AggressiveCompile.scala:28) ~[na:na]
    at sbt.Compiler$.apply(Compiler.scala:107) ~[na:na]
    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:479) ~[na:na]
    at sbt.Defaults$$anonfun$compileTask$1.apply(Defaults.scala:479) ~[na:na]
    at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:473) ~[na:na]
    at sbt.Scoped$$anonfun$hf2$1.apply(Structure.scala:473) ~[na:na]
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:41) ~[scala-library.jar:0.11.2]
    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295) ~[na:na]
    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$11.apply(Structure.scala:295) ~[na:na]
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) ~[na:na]
    at sbt.std.Transform$$anon$5.work(System.scala:67) ~[na:na]
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221) ~[na:na]
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:221) ~[na:na]
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18) ~[na:na]
    at sbt.Execute.work(Execute.scala:227) ~[na:na]
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221) ~[na:na]
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:221) ~[na:na]
    at sbt.CompletionService$$anon$1$$anon$2.call(CompletionService.scala:26) ~[na:na]
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.7.0_01]
    at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_01]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[na:1.7.0_01]
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) ~[na:1.7.0_01]
    at java.util.concurrent.FutureTask.run(Unknown Source) ~[na:1.7.0_01]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_01]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_01]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_01]

2 个答案:

答案 0 :(得分:1)

也许你使用另一种不同的java版本。我创建了一个项目A并使用java 6编译它。现在我将我的java更新为7.所以问题发生了!然后我用java 6运行它!问题已解决;

但我不知道如何在java7中运行它。我试图清理编译但也失败了。让我尝试其他方法!

答案 1 :(得分:0)

您是否尝试过http://localhost:9001?由于您的服务器是Listening for HTTP on port 9001...,这可能是正确的路径; )