Java 在play.db.ebean.EbeanPlugin中找不到合适的构造函数,如何解决此问题?

Java 在play.db.ebean.EbeanPlugin中找不到合适的构造函数,如何解决此问题?,java,playframework,playframework-2.0,guice,ebean,Java,Playframework,Playframework 2.0,Guice,Ebean,有以下错误: ConfigurationException:Guice配置错误: 1) 在play.db.ebean.EbeanPlugin中找不到合适的构造函数。类必须有一个(并且只有一个)用@Inject注释的构造函数,或者一个非私有的零参数构造函数。 at play.db.ebean.EbeanPlugin.class(EbeanPlugin.java:23) 查找play.db.ebean.EbeanPlugin时 1错误 有人能帮我吗?我对playframework还不熟悉,不能真正解

有以下错误:

ConfigurationException:Guice配置错误:

1) 在play.db.ebean.EbeanPlugin中找不到合适的构造函数。类必须有一个(并且只有一个)用@Inject注释的构造函数,或者一个非私有的零参数构造函数。 at play.db.ebean.EbeanPlugin.class(EbeanPlugin.java:23) 查找play.db.ebean.EbeanPlugin时

1错误

有人能帮我吗?我对playframework还不熟悉,不能真正解决这个问题

package models;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import play.db.ebean.Model;


@MappedSuperclass
public class Bar extends Model {

    @Id
    public String id;

    public String name;
}
plugin.sbt

    // The Play plugin
    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.2")

    // 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")
    addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.0.0")

    // Play enhancer - this automatically generates getters/setters for public fields
    // and rewrites accessors of these fields to use the getters/setters. Remove this
    // plugin if you prefer not to have this feature, or disable on a per project
    // basis using disablePlugins(PlayEnhancer) in your build.sbt
    addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")

    // Play Ebean support, to enable, uncomment this line, and enable in your build.sbt using
    // enablePlugins(SbtEbean). Note, uncommenting this line will automatically bring in
    // Play enhancer, regardless of whether the line above is commented out or not.
    addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")

您的类没有一个(而且只有一个)用@Inject注释的构造函数,也没有一个非私有的零参数构造函数

尝试添加一个非私有的零参数构造函数,例如

public Bar() {}

您的类没有一个(而且只有一个)用@Inject注释的构造函数,也没有一个非私有的零参数构造函数

尝试添加一个非私有的零参数构造函数,例如

public Bar() {}

我认为这些信息不足以回答这个问题。你能不能也包括一个部分模块?你指的是配置文件?我指的是你的GUI,我认为这不足以回答这个问题。你能不能也包括一个部分模块?你指的是配置文件?我指的是你的Guice啊,我的错-我假设你问题中的类是EbeanPlugin的简化版本(我看不出来)-你能用声明EbeanPlugin组件的guice config类更新你的问题吗?我想我还没有创建guice config类,但是我在plugins中添加了该组件。sbtI发布了plugins.sbtAh,我的错-我假设你问题中的类是EbeanPlugin的简化版本(我看不出来)-你能用声明EbeanPlugin组件的guice config类更新你的问题吗?我想我还没有创建guice config类,但是我在plugins.sbtI发布了plugins.sbt中添加了该组件