1

当我尝试在 glassfish 4.1 上部署我的应用程序时出现以下错误:

[class com.sample.model.Profile] uses a non-entity [class com.sample.model.ProfileEventMapping] as target entity in the relationship attribute [field events].

两个实体的表都在数据库中创建。

轮廓:

@Entity
public class Profile
...
@OneToMany(mappedBy = "profile", orphanRemoval = true)
private Set<ProfileEventMapping> events = new HashSet<>();

配置文件事件映射:

@Entity
public class ProfileEventMapping
...
@NotNull
@ManyToOne
private Profile profile;

在我的 persistence.xml 中,我选择包含所有实体:

<exclude-unlisted-classes>false</exclude-unlisted-classes>

有人有想法吗?

4

1 回答 1

0

我只用查找和替换重命名了孔项目。问题是在ear 项目中依赖于一个旧的.war 文件,该文件中有一个persistence.xml。刚刚删除了旧的依赖项和 BOOM。现在我只需要修复其他错误消息(“com.Profile[id = null] 不是已知的实体类型”)

于 2015-04-03T08:00:13.447 回答