java.lang.ClassCastException: com.sun.proxy.$Proxy5 cannot be cast to org.hibernate.impl.SessionFactoryImpl
将 SessionFactoryImpl sessionFactory = (SessionFactoryImpl) context.getBean("sessionFactory");
改为 SessionFactory sessionFactory = (SessionFactory) context.getBean("sessionFactory");
后,问题解决。
将 SessionFactoryImpl sessionFactory = (SessionFactoryImpl) context.getBean("sessionFactory");
改为 SessionFactory sessionFactory = (SessionFactory) context.getBean("sessionFactory");
后,问题解决。
2017-10-29
使用的spring3和hibernate3,在网上找不到spring3的spring-persistentce-core.jar这个jar包,可能是这个版本没有这个jar包,使用spring-hibernate和spring-jdbc和spring-dao这三个jar包代替,完成了spring与hibernate的整合。
2017-10-29
老师的讲课风格太符合我的学习习惯了。没有一句废话,全程无尿点。更可贵的就是英语都读对了。希望老师有更多课程推出
2017-10-06