简体   繁体   English

如何从jboss的war文件外部使用persistence.xml加载JPA jar

[英]how to load JPA jar with persistence.xml from outside of war file in jboss

I have JPA jar with persistence.xml and want to deploy in Jboss7. 我有带有persistence.xml的JPA jar,并且想要在Jboss7中进行部署。

Problem is that, i can't put inside WAR file(i know we can load from war file). 问题是,我无法放入WAR文件(我知道我们可以从war文件中加载)。

I have created module in jboss and placed jar file with including persistence.xml file inside META-INF\\ of the jar with ref: 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 我已经在jboss中创建了模块,并将jar文件与包括persistence.xml文件的jar文件一起放入了jar的META-INF \\中,并带有以下代码: http : //javahowto.blogspot.sg/2007/06/where-to-put-persistencexml-in -web-app.html Maven / Eclipse:在类路径中找不到任何META-INF / persistence.xml文件

After that jar file loaded, but persistence.xml not loaded. 加载该jar文件后,但未加载persistence.xml。

Is it possible to load persistence.xml from jar file ? 是否可以从jar文件加载persistence.xml?

if possible, can someone please let me know, where to place inside jar 如果可能的话,有人可以让我知道,放在罐子里的什么地方

Thanks 谢谢

If it is just about the persistence.xml, you could use a deployment-overlay. 如果仅与persistence.xml有关,则可以使用部署覆盖。 See eg https://docs.jboss.org/author/display/AS72/Deployment+Overlays 参见例如https://docs.jboss.org/author/display/AS72/Deployment+Overlays

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM