zoukankan      html  css  js  c++  java
  • Hibernate初学者配置常见错误

    1、cound not found /hibernate.cfg.xml 找不到配置文件(是否在src下,是否配置文件名拼写错误)

    2、不能解析文档:即文件能找到,但里面有错误 a) Could not parse configuration: /hibernate.cfg.xml b) Could not parse mapping document from resource cn/y2t99/test2/StudentBean.hbm.xml Error on line 13 of document  :错误发生的行数 The content of element type "class" is incomplete:class标记内容不完整,可能是没有结束标记,也可能是标记嵌套不正确,或者class标记内无内容

    3、 could not interpret id generator strategy: assgined,说明主键生成策略错误,单词拼写错误

    4、Could not find a getter for id in class com.jbit.user.bean.UserBean    UserBean有一个属性叫id,没提供getter/setter方法或者property标记的name中指定的属性名不存在

    5、'hibernate.dialect' must be set when no Connection avalable     创建配置文件对象时没有调用configure方法    错误写法:Configuration config=new Configuration();    正确写法:Configuration config=new Configuration().cinfigure();

    6、Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]    实体类应该实现序列化接口,不实现接口,可能正确,可能出问题;实现了接口,一定没问题

     

  • 相关阅读:
    C# 关键字 之 virtual
    Set NOCOUNT 和 SET XACT_ABORT
    radl+ReportViewer (转)
    销售利润分析案例
    实现动态展现报表:2种开发思路
    jdk,tomcat,myecplise程序安装步骤
    BI报表工具选型的整理总结
    MyEclipse 快捷键
    oracle biee
    跨数据库
  • 原文地址:https://www.cnblogs.com/shisha/p/3249736.html
Copyright © 2011-2022 走看看