Hibernate 4.0 -- anyone tested?
Hi
you could refer to Hibernate
download the War file and replace Hibernate jar, see if it working
I couldn't make it work with Hibernate 4 following that docs... It complains about some methods that probably changed between versions...
Right now I'm struggling with ZK + Hibernate trying to find a way for C3P0 pools not to get stuck forever on my SQL server... I'm trying to follow the steps on that documentation with no success... OpenSessionInViewListener seems to be the answer for my problems but I can't make it work with Hibernate 4...
what kind of error/exception do you get ? ZK's or Hibernate 's ?
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoSuchMethodError: org.hibernate.SessionFactory.getCurrentSession()Lorg/hibernate/classic/Session;
org.zkoss.zkplus.hibernate.HibernateUtil.currentSession(HibernateUtil.java:77)
org.zkoss.zkplus.hibernate.OpenSessionInViewListener.init(OpenSessionInViewListener.java:51)
org.zkoss.zk.ui.util.Configuration.invokeExecutionInits(Configuration.java:876)
org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:358)
org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:313)
org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:214)
org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:134)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
Steps I took:
- Created a brand new ZK Project.
- Copied Hibernate "required" and "c3p0" JARs to WEB-INF/lib.
- Created a basic hibernate.cfg.xml copied from http://books.zkoss.org/wiki/ZK_Developer's_Reference/Integration/Hibernate but just changing the driver to Mysql, no mappings yet...
- Run the project on Eclipse
I have also done a test from hibernate 3 to hibernate 4 and i am getting the same exception:
java.lang.NoSuchMethodError: org.hibernate.SessionFactory.getCurrentSession()Lorg/hibernate/classic/Session;
ZK - Open Source Ajax Java Framework
Subject says it all.