Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How to deploy persistence.xml in a web project?
How to deploy persistence.xml in a web project? [message #1444154] Mon, 13 October 2014 18:18 Go to next message
Marcos Antonio is currently offline Marcos AntonioFriend
Messages: 18
Registered: July 2009
Junior Member
Hello!

I have a web project created with 'Dynamic Web Project'. I don't use Ant neither Maven in this project and I want to deploy the persistence.xml file to the directory WEB-INF/classes/META-INF (that is the standard place where persistence.xml should reside according to the Java EE 7 standard in a war archive), but I don't see any way to configure this in Eclipse. Is there a way to achive this?

Thank you.

Marcos
Re: How to deploy persistence.xml in a web project? [message #1444241 is a reply to message #1444154] Mon, 13 October 2014 21:11 Go to previous messageGo to next message
Roberto Sanchez Herrera is currently offline Roberto Sanchez HerreraFriend
Messages: 36
Registered: January 2011
Member
Hi,
By default, a new dynamic web project creates a source folder called src, and inf you take a look at the deployment assembly page of the web project (right click on the project > Properties > Deployment Assembly), you will see there is a mapping with src as the source, and WEB-INF/classes as the Deploy path.

So, you can try creating a META-INF folder under src, and put your persistence.xml in that location.

BTW, if you add the JPA facet to your web project, META-INF/persistence.xml will be created for you under src.

Hope this helps.
Re: How to deploy persistence.xml in a web project? [message #1444662 is a reply to message #1444241] Tue, 14 October 2014 11:21 Go to previous message
Marcos Antonio is currently offline Marcos AntonioFriend
Messages: 18
Registered: July 2009
Junior Member
Hello, Roberto. Thank you for the answer.

I solved the problem creating (in Eclipse) the folders classes/META-INF under the folder WEB-INF and placing the persistence.xml there, like so:

WEB-INF/classes/META-INF/persistence.xml

Marcos
Previous Topic:JavaScript formatter and comma separated vars
Next Topic:Remote Rhino debugging - Exception inside eclipse when evaluating JavaScript
Goto Forum:
  


Current Time: Wed Nov 21 02:20:29 GMT 2018

Powered by FUDForum. Page generated in 0.02044 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top