【问题标题】:how to load JPA jar with persistence.xml from outside of war file in jboss如何从jboss中的war文件外部加载带有persistence.xml的JPA jar
【发布时间】: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


【解决方案1】:

如果只是关于persistence.xml,您可以使用部署覆盖。参见例如https://docs.jboss.org/author/display/AS72/Deployment+Overlays

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-23
    • 1970-01-01
    • 2012-12-06
    • 2016-10-16
    • 1970-01-01
    • 1970-01-01
    • 2014-12-30
    • 2015-08-27
    相关资源
    最近更新 更多