why?I allways got:Unable to load org.zkoss.zkplus.hibernate.OpenSessionInViewListener
Hi
I don't get your error, I am thinking maybe you could re-put the zkplus.jar to your project, maybe you are using the old one that doesn't have OpenSessionInViewListener
Thank you ! samchuang.
you are right. I solved the problem. But I got a new problem :
java.lang.NoClassDefFoundError: org/zkoss/zkplus/hibernate/HibernateUtil
I am sure I put the zkplus.jar and other necessary jar to my WEB-INF/lib.
public class UsersDaoHibernate extends GenericDaoHibernate<Users,Integer> implements UsersDao{
public List<Users> findAllOrderById() {
Session session = org.zkoss.zkplus.hibernate.HibernateUtil.currentSession();---------------------------------->get error.
List<Users> list = session.createQuery("from Users order by id desc").list();
return list;
}
}
I have no idea. i need help.
Hi
you could try clean and re-build the project.
if you wanna make sure zkplus.jar has HibernateUtil , you could unzip the zkplus.jar and find HibernateUtil.class, if not there, maybe you still put the wrong one, I can find HibernateUtil.class in the zkplus.jar
Hi samchuang,
I re-build a new project. that is OK.
Thanks your help.
ZK - Open Source Ajax Java Framework
in my zk.xml:
<zk>
<!-- Hibernate SessionFactory lifecycle -->
<listener>
<description>Hibernate SessionFactory lifecycle</description>
<listener-class>org.zkoss.zkplus.hibernate.HibernateSessionFactoryListener
</listener-class>
</listener>
<!-- Hibernate OpenSessionInView Pattern -->
<listener>
<description>Hibernate Open Session In View life-cycle</description>
<listener-class>org.zkoss.zkplus.hibernate.OpenSessionInViewListener
</listener-class>
</listener>
<!-- Hibernate thread session context handler -->
<listener>
<description>Hibernate thread session context handler</description>
<listener-class>org.zkoss.zkplus.hibernate.HibernateSessionContextListener
</listener-class>
</listener>
</zk>
but it does not work.
allways got:
Unable to load a listenr, [SYS jndi:/localhost/zkhibernate/WEB-INF/zk.xml line 15 col 12]
org.zkoss.zk.ui.UiException: Unable to load org.zkoss.zkplus.hibernate.OpenSessionInViewListener, at [SYS jndi:/localhost/zkhibernate/WEB-INF/zk.xml line 15 col 12]
how can solve this problem?