-
1. Re: JBDS 7 hibernate settings issue in JPA project
dgolovin Aug 20, 2013 5:14 PM (in response to pepelara)This issue has a workaround description, which says:
If the error occurs, one needs to open the Project properties > Hibernate Settings > select the console configuration and click on details.
The persistence unit name must be set, using the name found in the main persistence.xml.
Does it help?
-
2. Re: JBDS 7 hibernate settings issue in JPA project
pepelara Aug 22, 2013 7:37 PM (in response to dgolovin)Hi Denis,
Thanks for your reply.
Just a question because I am not sure about what do you mean when you say 'main persistence.xml'.
If I am not wrong I understand it is the only one persistence.xml file in the project and if it is the case,
when I get the details, I set the unit name to the one in the persistence.xml file. And still does not work,
I mean the same error persists.
Thanks,
Jose
-
3. Re: JBDS 7 hibernate settings issue in JPA project
maxandersen Aug 26, 2013 3:24 AM (in response to pepelara)the error should only occur if there are multiple persistence.xml's on your classpath.
Can you check if maybe your classpath contain the same folder containing your persistence.xml twice ?
-
4. Re: JBDS 7 hibernate settings issue in JPA project
pepelara Aug 26, 2013 2:26 PM (in response to maxandersen)Hi Max,
Thank you for your reply.
I have a project folder 'jpatest' and the persistence.xml is in two subfolders,
- src -> META-INF
- build -> classes -> META-INF
so I wonder if this is the problem
Thanks,
jose
-
5. Re: JBDS 7 hibernate settings issue in JPA project
pepelara Aug 26, 2013 7:51 PM (in response to pepelara)1 of 1 people found this helpfulIt is ok. I was getting wrong.
This is what I did to do it work,
- Create a JPA project
- Create hibernate.cfg.xml file
- Set the persistence.xml to the hibernate.cfg.xml file (property)
- Create entities from tables
- Add hibernate libraries to the project
On the other hand, the step 4 could be to switch to hibernate perspective
and set the Hibernate Code Generation Configurations that works ok.
Thanks,
jose
-
6. Re: JBDS 7 hibernate settings issue in JPA project
maxandersen Aug 27, 2013 3:11 AM (in response to pepelara)the file in build is the output from copying/building src. Just like you got .java in src and .class in build.
If *both* of these folders are on the classpath of the project - then yes, there will be problems.
It should only be the build one.
Can you check your classpath under Java preferences for the project ?
-
7. Re: JBDS 7 hibernate settings issue in JPA project
maxandersen Aug 27, 2013 3:12 AM (in response to pepelara)The steps you do here makes it not use JPA, but use plain hibernate setup. Just so you are aware that is not going to give the same behaviors
-
8. Re: JBDS 7 hibernate settings issue in JPA project
pepelara Aug 29, 2013 10:53 AM (in response to maxandersen)Hi Max,
Yes I decided to go to plain hibernate because this was my initial idea
but in a early future I will try out JPA so I will have this thread present.
Thank you Max, thanks a lot,
jose