This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
1) Create new persistence unit using the wizard 2) Persistence.xml will be created 3) Invoke the wizard a second time to create a new persistence unit 4) Wizard warns "The project has an invalid persistence.xml file" but won't explain what exactly is wrong. 5) persistence.xml node in Projects tab shows up like a normal XML file. There doesn't seem to be a way to bring up the wizard to edit it.
Seems to be caused by the removal of "source.root" in project.properties. As a workaround of http://www.netbeans.org/issues/show_bug.cgi?id=151385 I removed this property and defined conf.dir using a direct path. It isn't clear what "source.root" is supposed to be pointing to. I have the following path structure: /sources /conf /netbeans-project-directory Originally the following properties were set: source.root=src src.dir=${source.root}/java conf.dir=${source.root}/conf I redefined them to: source.root (removed) src.source.dir=${file.reference.Server-source} conf.dir=../conf Please advise me on what to do.
I can reproduce the problem if the conf.dir is outside the project and the persistence.xml.dir=${conf.dir}. But if I have the persistence.xml.dir pointing to different directory, for example, persistence.xml.dir=${src.source.dir}/META-INF, then it works. Can you try with the same change as I did and let me know if it works? Thanks.
Confirmed
Thanks for conforming. Since there is a workaround for it, it'll be looked into at some later time.
dongmeic, A few points: 1) When I wrote "confirmed" I simply checked that "persistence.xml.dir=${src.source.dir}/META-INF" worked. However, the key point worth mentioning here is that for me ${src.source.dir} *is* outside the project directory. As such, I don't think this confirms what you intended it to... 2) Why did you mark the issue as "resolved"? Shouldn't it remain open with target milestone set to "later"? 3) This issue is related to issue #151385
When I tried, the ${src.source.dir} can be outside or inside the project. The only time I see the problem is conf.dir is outside the project and persistence.xml.dir is the conf.dir. There is no "later" milestone. I can change it to "next"
what are steps before step "1) Create new persistence unit using the wizard"? where it should be created, what should be changed in what kind of project etc?
sergeyp, To be honest I don't recall. I believe a vanilla Web Project using the wizard will do.
Removing the INCOMPLETE kw, please reevaluate.
looks like I need more details, What is 'vanilla web project'? should I just create this project and try new persistence unit or modify the project first?
I tried creating a new Web project followed by two Persistence Units but the problem did not occur. Closing as WORKSFORME.
Sorry, I am able to reproduce it now. 1) Create a new Web Project using the wizard 2) Close netbeans, edit project.properties 3) Remove "source.root" 4) Set conf.dir=../conf 5) Set src.dir=../source 6) Restart Netbeans 7) Create a new Persistence Unit using the wizard 8) Repeat step 7 9) Netbeans complains that "persistence.xml is invalid" as mentioned in the original report Reproduced in build "nbms-and-javadoc-4007-on-090929"