gpt4 book ai didi

Junit中eclipse中的Java play框架错误

转载 作者:行者123 更新时间:2023-12-01 04:27:48 25 4
gpt4 key购买 nike

我正在 eclipse 中运行 play 框架,当我在 Junit 中运行一些 @Tests 时,似乎收到一些错误消息。我得到的错误是

[error] c.a.e.s.d.BeanDescriptorManager - Error in deployment
javax.persistence.PersistenceException: Error with [models.PurchaseRequest] It has not been enhanced but it's superClass [class play.db.ebean.Model] is? (You are not allowed to mix enhancement in a single inheritance hierarchy) marker[play.db.ebean.Model] className[models.PurchaseRequest]
at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.setEntityBeanClass(BeanDescriptorManager.java:1462) ~[avaje-ebeanorm-server.jar:na]
at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.createByteCode(BeanDescriptorManager.java:1138) ~[avaje-ebeanorm-server.jar:na]
at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readDeployAssociations(BeanDescriptorManager.java:1058) ~[avaje-ebeanorm-server.jar:na]
at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.readEntityDeploymentAssociations(BeanDescriptorManager.java:565) ~[avaje-ebeanorm-server.jar:na]
at com.avaje.ebeaninternal.server.deploy.BeanDescriptorManager.deploy(BeanDescriptorManager.java:252) ~[avaje-ebeanorm-server.jar:na]
at com.avaje.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:124) [avaje-ebeanorm-server.jar:na]

如果我从 application.conf 中删除 ebean.default="models.*" ,错误消息会发生变化,所以我认为这可能是问题的根源。

最佳答案

Play 期望您使用字节码增强(例如 AspectJ)将 JPA 注释连接到持久性提供程序(并且已经在您继承的父类(super class)上运行增强),但您没有运行该增强进入你的构建阶段。您需要确保增强步骤正在运行,并使用适当的 Eclipse 方面和/或 Maven 插件。

关于Junit中eclipse中的Java play框架错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18347535/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com