• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
驭风者
博客园    首页    新随笔    联系   管理    订阅  订阅

hibernate报ExceptionInInitializerError错误

今天在练习hibernate的criteria接口查询时候报了错:

java.lang.ExceptionInInitializerError
at test.testThisPro.createCriteria(testThisPro.java:23)--->Session session = HibernateSessionFactory.getSession();

但是这个引用的没错。同时xml文件检查也没有错误.

后来用原始的方法获取会话:

/*Configuration cfg=new Configuration().configure();
SessionFactory factory = cfg.buildSessionFactory();
Session session = factory.openSession();*/报下面的错:

org.hibernate.HibernateException: Unable to instantiate default tuplizer

请老师看后,Emp类中引用的Dept属性没有get/set方法。

posted @ 2016-06-07 10:00  驭风者已被使用??  阅读(562)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3