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]    实体类应该实现序列化接口,不实现接口,可能正确,可能出问题;实现了接口,一定没问题

     

  • 相关阅读:
    Asp.Net Core 程序部署到Linux(centos)生产环境(二):docker部署
    ASP.NET Core Docker部署
    将.NET Core部署在Docker
    linux 常用命令
    Wpf(Storyboard)动画简单实例
    uwp之图片旋转动画实现
    2011年度十大杰出IT博客获奖感言
    将BT下载对抗到底
    P3271 [JLOI2016]方 容斥+数学
    GCD is Funny
  • 原文地址:https://www.cnblogs.com/shisha/p/3249736.html
Copyright © 2011-2022 走看看