ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Hibernate 4.0 -- anyone tested?

whitewaterbug
27 Dec 2011 22:49:06 GMT
27 Dec 2011 22:49:06 GMT

Subject says it all.

samchuang
16 Jan 2012 01:10:50 GMT
16 Jan 2012 01:10:50 GMT

Hi

you could refer to Hibernate

download the War file and replace Hibernate jar, see if it working

trojahn
22 Mar 2012 21:04:27 GMT
22 Mar 2012 21:04:27 GMT

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...

samchuang
23 Mar 2012 00:36:47 GMT
23 Mar 2012 00:36:47 GMT

what kind of error/exception do you get ? ZK's or Hibernate 's ?

trojahn
23 Mar 2012 13:19:13 GMT
23 Mar 2012 13:19:13 GMT

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

samchuang
26 Mar 2012 00:51:32 GMT
26 Mar 2012 00:51:32 GMT

hi

from the exception, it looks like a bug, you could try to post bug here

riczun
29 Mar 2012 07:59:13 GMT
29 Mar 2012 07:59:13 GMT

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;

samchuang
23 Apr 2012 01:05:46 GMT
23 Apr 2012 01:05:46 GMT

hi @riczun

you could post bug here