0

Hibernate 4.0 -- anyone tested?

asked 2011-12-27 22:49:06 +0800

whitewaterbug gravatar image whitewaterbug
15 1

Subject says it all.

delete flag offensive retag edit

11 Replies

Sort by ยป oldest newest

answered 2012-01-16 01:10:50 +0800

samchuang gravatar image samchuang
4084 4

Hi

you could refer to Hibernate

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

link publish delete flag offensive edit

answered 2012-03-22 21:04:27 +0800

trojahn gravatar image trojahn
24

updated 2012-03-22 21:05:49 +0800

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

link publish delete flag offensive edit

answered 2012-03-23 00:36:47 +0800

samchuang gravatar image samchuang
4084 4

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

link publish delete flag offensive edit

answered 2012-03-23 13:19:13 +0800

trojahn gravatar image trojahn
24

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

link publish delete flag offensive edit

answered 2012-03-26 00:51:32 +0800

samchuang gravatar image samchuang
4084 4

hi

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

link publish delete flag offensive edit

answered 2012-03-29 07:59:13 +0800

riczun gravatar image riczun
36 2
www.riczun.nl

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;

link publish delete flag offensive edit

answered 2012-04-23 01:05:46 +0800

samchuang gravatar image samchuang
4084 4

hi @riczun

you could post bug here

link publish delete flag offensive edit

answered 2013-03-22 07:04:23 +0800

kazma gravatar image kazma
15 3

am having the same problem, the JavaDoc says that the org.hibernate.SessionFactory.getCurrentSession() is deprecated how can i use the new class can anyone provide me an example with ZK + hibernate 4 i just need to see how the sessionFactory is created, since the HibernateUtil class is deprecated.

Thank you!

link publish delete flag offensive edit

answered 2013-03-22 10:55:37 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2611 3 8
http://emrpms.blogspot.in...

I have examples, but all maven based. You can check here

link publish delete flag offensive edit

answered 2013-03-24 23:39:29 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2611 3 8
http://emrpms.blogspot.in...

Yes / No. You can intregrate ZK with hibernate with spring or without spring also. You can find my examples here for ZK + Hibernate without Spring.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-12-27 22:49:06 +0800

Seen: 1,010 times

Last updated: Mar 25 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More