Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Not finding persistence.xml from linked resource
Not finding persistence.xml from linked resource [message #638309] Wed, 10 November 2010 14:01 Go to next message
Larry  is currently offline Larry
Messages: 30
Registered: December 2009
Member
I have a linked resource that points to my projects files. The files reside in 3 separate projects in my source control app.

When creating the project, I removed the "src" folder and
then went back into the Properties -> Build Path and
linked in a "JAVA" directory as the "src" folder.

This is the link I created: "src --> JAVA"

This is the linked dir structure:
JAVA
    src1
        classes
        build.xml
    src2
        classes
        build.xml
        META-INF
            persistence.xml


I thought the Eclipse would look under the source folder(s) for a "META-INF" folder to get the persistence.xml file. This is not working - I keep getting a "No persistence.xml found" error. I tried linking in the META-INF and still could not get it to work. I also tried setting it as a source folder, and still could not be found.

I did find a way to make it work. I linked in each src directory with separate links. The problem with this is having to link in all the other files/folders (build.xml, properties, lib folder). I tried to link them in with another link, and use "Exlusion pattern" to remove the src directory(ies), but this didn't seem to work. I read that the "Inclusion/Exclusion" patterns do not work with linked resources. This leaves me to have to link in all files/folders separately. Can be done, but what a pain.

Can anybody tell me if I'm doing something wrong in linking the entire JAVA directory (and not finding persistence.xml).

Is there a different solution to link in all files excluding the source files as described by the method of linking in each source file separately?

Thanks for the help (if any)


Re: Not finding persistence.xml from linked resource [message #638576 is a reply to message #638309] Thu, 11 November 2010 11:40 Go to previous messageGo to next message
Paul Fullbright is currently offline Paul Fullbright
Messages: 199
Registered: July 2009
Senior Member
Firstly, Larry, since you are talking about configuring EclipseLink metadata within the Eclipse IDE, I'd like to refer you to the Dali forum:

http://www.eclipse.org/forums/index.php?t=thread&frm_id= 113

Dali is the Eclipse project that provides tooling for EclipseLink/JPA/JAXB metadata configuration.


Secondly, the short answer is that it *should* work, but it depends a little on what version of Dali/WTP you're using and how you have your project configured.

The most likely solution is that in the process of removing your source folder and re-adding/linking it, you lost the deploy path mapping for your "src" folder. In your project properties, under the "Deployment Assembly" node you should see an entry that maps the "/src" source path to the "/" deploy path. If not, add it, and the persistence.xml should be found. If not, please respond with the version of Dali/WTP you're using and whatever other details you can give us about how your project is configured (over in the Dali forum, kindly).

Thanks
Re: Not finding persistence.xml from linked resource [message #638577 is a reply to message #638576] Thu, 11 November 2010 11:44 Go to previous messageGo to next message
Paul Fullbright is currently offline Paul Fullbright
Messages: 199
Registered: July 2009
Senior Member
Actually, what you may have to do is to link each actual source folder (src1, src2) individually, and then provide deploy path mappings for each. I'm not sure you can use a source linkage in the exact way you've described.
Re: Not finding persistence.xml from linked resource [message #638605 is a reply to message #638577] Thu, 11 November 2010 13:39 Go to previous messageGo to next message
Paul Fullbright is currently offline Paul Fullbright
Messages: 199
Registered: July 2009
Senior Member
After a little bit of research, I think what you want to do is create a linked *folder* (not source folder) to JAVA, but then add java source folders for each src folder (src1, src2) therein.
Re: Not finding persistence.xml from linked resource [message #638650 is a reply to message #638605] Thu, 11 November 2010 19:07 Go to previous message
Larry  is currently offline Larry
Messages: 30
Registered: December 2009
Member
Sorry about being in wrong forum.

I think you solved it with the Linked Folder, and then adding the src folders.

Thanks for the help!!!
Previous Topic:[JPA] Initializing a persistence unit with information retrieved at runtime
Next Topic:ManyToOne with foreign keys on distinct tables
Goto Forum:
  


Current Time: Fri Apr 18 10:12:30 EDT 2014

Powered by FUDForum. Page generated in 0.01651 seconds