[英]java.lang.IllegalArgumentException: Unable to locate persister
I am working on a project migrated from WLS8 to WildFly 10. Hibernate 3.3 (implementation of JPA) was used in WLS8. 我正在研究一个从WLS8迁移到WildFly 10的项目。WLS8中使用了Hibernate 3.3(JPA的实现)。 However, WildFly 10 doesn't support this version so I use the default Hibernate (version 5) bundled with WildFly 10. 但是,WildFly 10不支持此版本,因此我使用与WildFly 10捆绑在一起的默认Hibernate(版本5)。
But I got run time error: 但是我遇到了运行时错误:
ERROR [stderr] (default task-32) java.lang.IllegalArgumentException: Unable to locate persister: com.x.switch.entity.LOC 错误[stderr](默认任务32)java.lang.IllegalArgumentException:无法找到持久器:com.x.switch.entity.LOC
Here is the file/class structure in .war
: 这是.war
的文件/类结构:
--WEB-INF --Web-INF
--classes --classes
--com --com
--META-INF --meta-INF
--persistence.xml --persistence.xml
--lib --lib
--web.xml --web.xml
--jboss-web.xml --jboss-web.xml中
I couldn't figure out why the entity is not found (as it is under classes and packaged in war file). 我不知道为什么找不到该实体(因为它在类下并包装在war文件中)。
Ironically after I list all Entities in persistence.xml, the error is gone. 具有讽刺意味的是,在persistence.xml中列出所有实体之后,该错误消失了。 It's fixed but I still don't understand why I need to do so since every Entity is annotated. 它是固定的,但是我仍然不明白为什么要这样做,因为每个实体都带有注释。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.