0

ZK3.5 + Hibernate

asked 2008-09-19 09:36:24 +0800

shinfa gravatar image shinfa
3

I've follow "Hibernate + Zk" article in small talk to see how to use ZK's new Hibernate features to seamlessly integrate Hibernate and ZK together. I've already load example.war and import to my project. and It can run.
but when I've try to create my own projects and try to use ZK3.5 with Hibernate 3.3.1 and use hibernate-annotations-3.4.0.GA.I'm got

java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.AnnotationConfiguration
org.zkoss.zkplus.hibernate.HibernateUtil.java5Factory(HibernateUtil.java:135)
org.zkoss.zkplus.hibernate.HibernateUtil.initSessionFactory(HibernateUtil.java:117)
org.zkoss.zkplus.hibernate.HibernateUtil.initSessionFactory(HibernateUtil.java:108)
org.zkoss.zkplus.hibernate.HibernateUtil.getSessionFactory(HibernateUtil.java:68)
org.zkoss.zkplus.hibernate.HibernateUtil.currentSession(HibernateUtil.java:75)
org.zkoss.zkplus.hibernate.OpenSessionInViewListener.init(OpenSessionInViewListener.java:54)
org.zkoss.zk.ui.util.Configuration.invokeExecutionInits(Configuration.java:798)
org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:343)
org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:296)
org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:227)
org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:167)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Can you give me advice or hints how to solve this problem?

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2008-09-19 12:44:52 +0800

sousa1981 gravatar image sousa1981
573 4

There is Hibernate's dependence libs not found.

In hibernate there's file readme.txt which explanation necessary libs.

hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-core.jar
hibernate-entitymanager.jar
javassist.jar
antlr-2.7.6.jar
commons-codec-1.3.jar
commons-collections.jar
commons-logging.jar
dom4j-1.6.1.jar
slf4j-api-1.5.0.jar
slf4j-log4j12-1.5.0.jar
jta.jar
persistence.jar

link publish delete flag offensive edit

answered 2009-02-13 15:22:04 +0800

bob007 gravatar image bob007
384 3 4

updated 2009-02-13 15:24:47 +0800

I got to add these libs for hibernate

antlr-2.7.6.jar
commons-collections-3.1.jar
dom4j-1.6.1.jar
ejb3-persistence.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-core.jar
hibernate-entitymanager.jar
hibernate3.jar
javassist-3.4.GA.jar
jta-1.1.jar
log4j.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.6.jar

and the connector for my database
ex: mysql-connector-java-5.1.7-bin.jar

now its working,
Steve

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: 2008-09-19 09:36:24 +0800

Seen: 266 times

Last updated: Feb 13 '09

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