当前位置:  开发笔记 > 编程语言 > 正文

Play2:播放阶段命令失败并显示'not found:type SetupContext'

如何解决《Play2:播放阶段命令失败并显示'notfound:typeSetupContext'》经验,为你挑选了1个好方法。

我目前正在尝试将一个Play 2.2.2应用程序部署到heroku,并且play stage命令对我失败,输出如下:

$ play clean compile stage
[info] Loading project definition from /Users/apotapov/Dropbox/workspace/test/project
[info] Set current project to test (in build file:/Users/apotapov/Dropbox/workspace/test/)
[success] Total time: 0 s, completed Apr 9, 2014 4:45:28 PM
[info] Updating {file:/Users/apotapov/Dropbox/workspace/test/}test...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 3 Scala sources and 70 Java sources to /Users/apotapov/Dropbox/workspace/test/target/scala-2.10/classes...
[success] Total time: 28 s, completed Apr 9, 2014 4:45:56 PM
[info] Packaging /Users/apotapov/Dropbox/workspace/test/target/scala-2.10/test_2.10-1.0-SNAPSHOT-sources.jar ...
[info] Wrote /Users/apotapov/Dropbox/workspace/test/target/scala-2.10/test_2.10-1.0-SNAPSHOT.pom
[info] Done packaging.
[info] Main Scala API documentation to /Users/apotapov/Dropbox/workspace/test/target/scala-2.10/api...
[info] Packaging /Users/apotapov/Dropbox/workspace/test/target/scala-2.10/test_2.10-1.0-SNAPSHOT.jar ...
[info] Done packaging.
[error] /Users/apotapov/Dropbox/workspace/test/app/com/bvg/controllers/json/serializers/TestJacksonModule.java:17: not found: type SetupContext
[error]     public void setupModule(SetupContext context) {
[error]                             ^
model contains 120 documentable templates
[error] one error found
[error] (compile:doc) Scaladoc generation failed
[error] Total time: 10 s, completed Apr 9, 2014 4:46:07 PM

这是我的build.sbt:

name := "test"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
    javaJdbc,
    cache,
    "be.objectify" %%                       "deadbolt-java" %               "2.2.1-RC2",
    "com.google.guava" %                    "guava" %                       "r09",
    "com.codahale.metrics" %                "metrics-core" %                "3.0.1",
    "org.springframework" %                 "spring-context" %              "4.0.2.RELEASE",
    "org.springframework.data" %            "spring-data-jpa" %             "1.5.1.RELEASE",
    "postgresql" %                          "postgresql" %                  "9.1-901.jdbc4",
    "org.hibernate" %                       "hibernate-entitymanager" %     "4.3.4.Final",
    "com.typesafe" %%                       "play-plugins-redis" %          "2.2.0",
    "com.typesafe.play" %%                  "play-cache" %                  "2.2.0",
    "com.restfb" %                          "restfb" %                      "1.6.11"
)

resolvers += Resolver.url("Objectify Play Repository", url("http://schaloner.github.com/releases/"))(Resolver.ivyStylePatterns)

resolvers += Resolver.url("Objectify Play Snapshot Repository", url("http://schaloner.github.com/snapshots/"))(Resolver.ivyStylePatterns)

resolvers += "Sedis Repo" at "http://pk11-scratch.googlecode.com/svn/trunk"

play.Project.playJavaSettings

这是违规文件:

package com.bvg.controllers.json.serializers;

import java.util.Map;

import com.fasterxml.jackson.databind.module.SimpleModule;

public class TestJacksonModule extends SimpleModule {
    private static final long serialVersionUID = 1L;

    protected Map, Class> mixIns;

    public FeudJacksonModule() {
        super("FeudJacksonModule");
    }

    @Override
    public void setupModule(SetupContext context) {
        super.setupModule(context);

        for (Map.Entry, Class> mixIn : mixIns.entrySet()) {
            context.setMixInAnnotations(mixIn.getKey(), mixIn.getValue());
        }
    }

    public void setMixIns(Map, Class> mixIns) {
        this.mixIns = mixIns;
    }
}

我尝试添加jackson-databind depndency但它似乎没有帮助: "com.fasterxml.jackson.core" % "jackson-databind" % "2.2.2"

我已经搜遍了所有但似乎无法找到原因.这里有一个相关的讨论:

https://groups.google.com/forum/#!topic/play-framework/aa90AAp5bpo

它提到禁用scaladoc一代.根据讨论的建议,不确定这是使用build.sbt而不是Build.scala的原因或方法.有任何见解赞赏.



1> Andrew Potap..:

所以你需要做的就是在build.sbt的末尾添加以下行:

sources in doc in Compile := List() 

希望这能让别人头疼...


虽然我想了解那是什么
推荐阅读
云聪京初瑞子_617
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有