简体   繁体   中英

Learning resource for configuring Hibernate as JPA 2.0 provider on Tomcat Apache with MySQL

I am trying to created a new java project. I have tried various examples available on the web but my project works sometimes and doesn't rest of the time. It seems that there happens some error which is not thrown when hibernate is doing a secondPassCompile() after creating factory.Can someone tell me a good resource to follow or give me some pointers on where I might be going wrong?

Is there any particular reason for using Tomcat? If you are trying to learn Eclipse with Hibernate as the JPA implementation, I would suggest you use JBoss as the app server. That way you can learn EJBs along the way if you prefer. If you want to learn just Eclipse and JPA there is no need to use any server - JPA can be practised just in JavaSE.

EDIT: Recently I had to create a simple JPA project. This is what I did: Create a new Java Project in eclipse. Download Hibernate 3.6.1 from http://www.hibernate.org/downloads . From the download directory take the Hibernate.jar and from the jpa directory take the one jar there. Take all the jars from lib\\required. Add the above to your buildpath. Add logback jars - classic and core jars. For the database I used HSQLDB. Just one jar hsqldb.jar. Thats it! Enjoy JPA from here onwards.

I have found the slides at http://www.coreservlets.com/ very useful when trying to get up to date with EJB3/Hibernate and JSF. Complete and yet simple enough that you do not get ovewelmed by pages and pages of sample code. I wish they had something like that for MFC.

They have materials about Hibernate, I would definitely look at them.

About the JBoss issue, it is interesting if you plan to go into EJB3 later. It is not difficult to have a basic configuration working and, on top of that, it is based in Tomcat.

That said, if you are new to Hibernate, I would definitely test it first in JavaSE and then later go with it in a server (Tomcat or whatever).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM