當我單元測試我的playframework2應用程序時,遇到以下異常。在Play Framework 2上進行單元測試時發生的錯誤
[錯誤] caesdpDeployCreateProperties - 錯誤與models.Position領域:取景器 java.lang.IllegalStateException:在公共play.db.ebean.Model $查找器(java.lang.Class中,java的重複參數類型。 lang.Class) at com.avaje.ebeaninternal.server.type.reflect.ImmutableMetaFactory.scoreConstructors(ImmutableMetaFactory.java:106)〜[avaje-ebeanorm.jar:na] at com.avaje.ebeaninternal.server.type。 reflect.ImmutableMetaFactory.createImmutableMeta(ImmutableMetaFactory.java:21)〜[avaje-ebeanorm.jar:na] at com.avaje.ebeaninternal.server.type.DefaultTypeManager.recursiveCreateScalarDataReader(DefaultTypeManager.java:185)〜[avaje-ebeanorm。 jar:na] at com.avaje.e beaninternal.server.deploy.parse.DeployCreateProperties.createProp(DeployCreateProperties.java:313)[avaje-ebeanorm.jar:na] at 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]
[錯誤] caesdpDeployCreateProperties - 與models.ClubPosition字段錯誤:finder java.lang.IllegalStateException:公共play.db.ebean.Model中的重複參數類型$ Finder(java.lang.Class,java.lang.Class) at com.avaje .ebeaninternal.server.type.reflect.ImmutableMetaFactory.scoreConstructors(ImmutableMetaFactory.java:106)〜[avaj e-ebeanorm.jar:na] at com.avaje.ebeaninternal.server.type.reflect.ImmutableMetaFactory.createImmutableMeta(ImmutableMetaFactory.java:21)〜[avaje-ebeanorm.jar:na] at com.avaje.ebeaninternal。 server.type.DefaultTypeManager.recursiveCreateScalarDataReader(DefaultTypeManager.java:185)〜[avaje-ebeanorm.jar:na] at com.avaje.ebeaninternal.server.deploy.parse.DeployCreateProperties.createProp(DeployCreateProperties.java:313)[avaje -ebeanorm.jar:na] at com.avaje.ebeaninternal.server.deploy.parse.DeployCreateProperties.createProp(DeployCreateProperties.java:341)[avaje-ebeanorm.jar:na] at com.avaje.ebeaninternal.server。 deploy.parse.DeployCreateProperties.createProperties(DeployCreateProperties.java:128)[avaje-ebeanorm.jar:na]
我可以知道,我怎麼能解決這個問題?
謝謝
我無法確定沒有模型的代碼,但我懷疑Position和ClubPosition是通過繼承關聯的,並且在他們中都定義了一個具有相同名稱和相同類型參數的'finder'字段。然後他們在編譯時發生碰撞。 – 2manyprojects