|
[
Permalink
| « Hide
]
Max Rydahl Andersen added a comment - 10/Jan/08 03:30 PM
is the META-INF/persistence.xml actually on the classpath of your project ? why is it not inside src so it will end up in bin
This is the structure of my project. It is standart Eclipse plugin project.
Just added screenshot of my project structure. As you can see, META-INF also contains MANIFEST.MF file. I didn't put it here myself - Eclipse (for plugin projects) itself creates this META-INF folder in THIS PLACE (and not in src folder). Eclipse also automatically appends line:
META-INF/,\ to build.properties file, so META-INF directory finally end up in bin folder. I tried to play with classpath tab of Hibernate Configuration creation wizard, tried to add the directory that contains META-INF as local directory, as external directory - no result, wizard still cannot see this META-INF/persistence.xml. Do you want to say, that wizard looks for META-INF only in src folder (or bin folder)? I have validated this once more: Eclipse -> File -> New -> Project... -> Plug-in Project creates separate META-INF, src, and bin directories.
I tried a quick hack: I copied META-INF directory to bin folder, and surprise - Hibernate Configuration got created without problems. So it seems that if I add my project to the classpath (Classpath tab of wizard), it looks for META-INF directory ONLY within [myproject]/bin folder. It should also look for it in [myproject]/ (root) folder, because all plug-in projects have META-INF in root folder (not in src), and you cannot move META-INF to src/ because this breaks plugin.xml file (I tried and had difficulties restoring everything back).
This issue may be closed. The solution is to add additional META-INF folder containing persistence.xml file to src directory.
the root of your project is not part of the classpath so we won't see it...normal java classloader behavior.
I had the same / similar problems:
"Could not load persistence unit {0}" or some such in nightly... really need some better error feedback I think. Something like "Are you sure your presistence.xml is in META-INF/presistence.xml and on the class path? yes- but that was just me suggesting an error message that should be shown - i don't think i actually spelt it like that :) mind you, it was a while ago :)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||