我做一个项目,用的技术是:jdk1.5+hibernate3,我在jboss portal运行时报错:
Error:java.lang.ClassCastException: org.hibernate.validator.event.ValidateEventListener
请问是什么错误?
我的hibernate.cfg.xml是:
<hibernate-configuration >
<session-factory >
<property name="connection.url" >jdbc:mysql://localhost/manage </property >
<property name="connection.username" >root </property >
<property name="connection.driver_class" >com.mysql.jdbc.Driver </property >
<property name="dialect" >org.hibernate.dialect.MySQLDialect </property >
<property name="connection.password" >jacky </property >
<property name="show_sql" >true </property >
<mapping class="hibernateinfo.per"/ >
</session-factory >
</hibernate-configuration >
调用代码是:
SessionFactory SessionFactory =new AnnotationConfiguration().configure().buildSessionFactory(); Session session = SessionFactory.openSession();
Transaction tran = session.beginTransaction();
Query query = session.createQuery("from per as c where c.name=:pername");
query.setString("pername","jacky");
List pers = query.list();
tran.commit();
session.close();
------解决方法--------------------------------------------------------
http://wplqw.javaeye.com/admin/show/144572