【发布时间】:2017-12-01 12:56:56
【问题描述】:
我有带有 persistence.xml 的 JPA jar,想在 Jboss7 中部署。
问题是,我不能放入 WAR 文件中(我知道我们可以从 WAR 文件中加载)。
我在 jboss 中创建了模块,并在 jar 的 META-INF\ 中放置了包含 persistence.xml 文件的 jar 文件 参考: http://javahowto.blogspot.sg/2007/06/where-to-put-persistencexml-in-web-app.html Maven/Eclipse: Could not find any META-INF/persistence.xml file in the classpath
在加载该 jar 文件之后,但没有加载 persistence.xml。
是否可以从jar文件中加载persistence.xml?
如果可能的话,谁能告诉我,放在罐子里的什么地方
谢谢
【问题讨论】:
-
如果你使用Spring,请检查
persistenceXmlLocation属性 -
我没有使用弹簧
-
你使用 jboss-deployment-structure.xml 吗?它看起来怎样?你导出 META-INF 了吗?
标签: java jpa jboss persistence.xml