当我尝试在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<>();
ProfileEventMapping:
@Entity
public class ProfileEventMapping
...
@NotNull
@ManyToOne
private Profile profile;
在我的persistence.xml中,我选择包含所有实体:
<exclude-unlisted-classes>false</exclude-unlisted-classes>
任何人都有想法?
答案 0 :(得分:0)
我通过查找和替换重命名了洞项目。问题是在ear项目中依赖于一个旧的.war文件,该文件中有一个persistence.xml。刚刚删除了旧的依赖项和BOOM。现在我只需要修复其他错误消息(&#34; com.Profile [id = null]不是已知的实体类型&#34;)