Cannot find persistence block and reverse engineering tools

I am currently creating my entities and DAOs using Hibernate Tools and reverse engineering. My configuration is Eclipse Indigo, JBoss AS7, Hibernate Tools 3.4 and Hibernate 4. The problem is that I am trying to deploy my .jar for JBoss AS7. I get this:

http://pastebin.com/1hvHBM7z

Or rather:

Cannot find persistence block named null in deployment "BusinessLayer.jar"

Now I was looking for this problem and it suggests that I should have a persistence.xml file in META-INF. The fact is that the generation did nothing regarding this file (even turned off its generation when I checked annotations, not JPA during console configuration), and when I look at the samples, I'm not sure what to specify ... Another question: from what I understand, this file is necessary for EntityManager, but why do I need it if all the necessary data is already in my hibernate.cfg.xml (because I mean that the two files look similar ... )?

+2
source share
1 answer

Actually, it looks like you need to have xml persistence, which gets rid of the problem above. Then you may get a new exception: the JDBC driver was not found, etc. The problem came up with JBoss 7 and Postgre9 for me. More information here (last post).

0
source share

All Articles