Не удалось найти подходящий конструктор в play.db.ebean.EbeanPlugin, как решить эту проблему?
Имея следующую ошибку:
ConfigurationException: Guice ошибки конфигурации:
1) Не удалось найти подходящий конструктор в play.db.ebean.EbeanPlugin. Классы должны иметь либо один (и только один) конструктор, аннотированный @Inject, либо конструктор с нулевым аргументом, который не является закрытым. в play.db.ebean.EbeanPlugin.class(EbeanPlugin.java:23) при поиске play.db.ebean.EbeanPlugin
1 ошибка
Может ли кто-нибудь помочь мне с этим, я новичок в игровой рамке и не могу действительно решить такую проблему.
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")
1 ответ
В вашем классе нет одного (и только одного) конструктора, аннотированного @Inject, или конструктора с нулевым аргументом, который не является частным
Попробуйте добавить конструктор с нулевым аргументом, который не является закрытым, например
public Bar() {}