首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

java.lang.ClassCastException: org.hibernate.validator.event.ValidateEventListene

2014-01-26 
我做一个项目,用的技术是:jdk1.5+hibernate3,我在jboss portal运行时报错: Error:java.lang.ClassCastExcep

我做一个项目,用的技术是: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

        

热点排行