在对playframework2应用进行单元测试时,遇到以下异常。


  [错误] c.a.e.s.d.p.DeployCreateProperties-模型错误。位置字段:finder
  java.lang.IllegalStateException:公共play.db.ebean.Model $ Finder(java.lang.Class,java.lang.Class)中的参数类型重复
      在com.avaje.ebeaninternal.server.type.reflect.ImmutableMetaFactory.scoreConstructors(ImmutableMetaFactory.java:106)〜[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.type.reflect.ImmutableMetaFactory.createImmutableMeta(ImmutableMetaFactory.java:21)〜[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.type.DefaultTypeManager.recursiveCreateScalarDataReader(DefaultTypeManager.java:185)〜[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.deploy.parse.DeployCreateProperties.createProp(DeployCreateProperties.java:313)[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.deploy.parse.DeployCreateProperties.createProp(DeployCreateProperties.java:341)[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.deploy.parse.DeployCreateProperties.createProperties(DeployCreateProperties.java:128)处[avaje-ebeanorm.jar:na]
  
  [错误] c.a.e.s.d.p.DeployCreateProperties-models.ClubPosition字段错误:finder
  java.lang.IllegalStateException:公共play.db.ebean.Model $ Finder(java.lang.Class,java.lang.Class)中的参数类型重复
      在com.avaje.ebeaninternal.server.type.reflect.ImmutableMetaFactory.scoreConstructors(ImmutableMetaFactory.java:106)〜[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.type.reflect.ImmutableMetaFactory.createImmutableMeta(ImmutableMetaFactory.java:21)〜[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.type.DefaultTypeManager.recursiveCreateScalarDataReader(DefaultTypeManager.java:185)〜[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.deploy.parse.DeployCreateProperties.createProp(DeployCreateProperties.java:313)[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.deploy.parse.DeployCreateProperties.createProp(DeployCreateProperties.java:341)[avaje-ebeanorm.jar:na]
      在com.avaje.ebeaninternal.server.deploy.parse.DeployCreateProperties.createProperties(DeployCreateProperties.java:128)处[avaje-ebeanorm.jar:na]


我可以知道如何解决吗?

谢谢

最佳答案

可能会声明finder时没有修饰符静态变量?

在模型中声明不带静态修饰符的find时,我遇到了同样的问题。

08-06 05:59