初次配置hibernate在myeclipse上:

出现三个问题,怎么都不好使,比对代码,没有问题,查看路径还是没有问题:

1、org.hibernate.HibernateException: /hibernate.cfg.xml not found

路径问题:

说找不到我的hibernate.cfg.xml,比对之后发现没有问题:

配置好后应该是这样的,然后mapping中要使用当前的文件路径,把之前的都删了。

2、This project is not a MyEclipse Hibernate Project. Assuming Hibernate 3 capablites for the configuration editor.;

显示这个没做改动,最后自然好使,有的人说还可以配置下:

myeclipse-->add hibernate capabilites -->next-->hibernate config file --> existing -->选择现有工程存在的hibernate配置文件--> next --> 不生成factory class --> end

更改后我的还是无效,大家可以试试也许你有效。

3、'hibernate.dialect' must be set when no Connection avalable

无奈下我把例子导入了工程中,然后运行,曝出了错误是这个,这个错误说我没有对其进行语言识别的配置,然后我把下边这句加了进去

<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>结构如图:

然后所有问题都消失了。

4、在数据库中要提前建立好

<property name="connection.url">
jdbc:mysql://localhost:3306/liuyang_person_hibernate
</property>

名字为liuyang_person_hibernate(我的是这个),这个的数据库,然后写好测试类,运行一下就好使了

5、最终结果

org.hibernate.HibernateException: /hibernate.cfg.xml not found等三个问题的更多相关文章

  1. 问题Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found解决方法

    问题Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not fo ...

  2. hibernate 使用 hibernate tool 生成配置文件和实体类

    安装Hibernate插件 下载所需的Hibernatetools  http://www.hibernate.org/6.html 将下载得到的文件解压得到的features和plugins文件夹, ...

  3. org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml

    org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml at org.hibernate ...

  4. hibernate hibernate.cfg.xml component 组件

    1.为什么使用component组件? 当一个表的列数目比较多时,可以根据属性分类,将一个java对象拆分为几个对象. 数据库还是一张表,不过有多个对象与之对应. 2.实例 2.1 Java 对象: ...

  5. 关于Could not parse configuration: /hibernate.cfg.xml的问题

    第一次在eclipse上配置hibernate,问题百出啊,比如下面的org.hibernate.HibernateException: Could not parse configuration: ...

  6. hibernate.cfg.xml配置(Oracle+c3p0)

    说明:数据库:Oracle10g:连接池:c3p0 结构: 一.配置hibernate.cfg.xml <?xml version="1.0" encoding=" ...

  7. Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable t

    spring与hibernate整合然后出现如下错误: org.springframework.beans.factory.BeanCreationException: Error creating ...

  8. org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xm

    org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xm 检查jar包是否正确以及配置的xm ...

  9. 解决离线Could not parse configuration:hibernate.cfg.xml错误

    离线使用hibernate tool 生成反向工程,在配置 配置文件完,生成配置文件后,会报出org.hibernate.HibernateException: Could not parse con ...

随机推荐

  1. XmlHttpRequest对象 ajax核心之一

    XMLHttpRequest 对象 XML XSLT XML 解析器 XMLHttpRequest 对象用于在后台与服务器交换数据. 什么是 XMLHttpRequest 对象? XMLHttpReq ...

  2. Openning SharePoint - 80 website gives HTTP 404 Error, The webpage cannot be found ! on SharePoint 2013

    ask: I tried to open the SharePoint - 80 throw Browse in IIS, but I get HTTP 404 Error (The webpage ...

  3. jQuery height()、innerHeight()、outerHeight()函数的区别详解

    参考来源:http://www.jb51.net/article/84897.htm 代码示例(可复制到编辑器直接打开): <!DOCTYPE html> <html lang=&q ...

  4. express + mongodb 搭建一个简易网站(二)

    express + mongodb 搭建一个简易网站 (二) 在搭建网站(一)中,实现了简单的路由功能,这离一个完整的网站还差的有点远,继续撸代码吧. 1.首先在根目录下新建一个views文件夹,用来 ...

  5. pip & Jinja2

    [pip&Jinja2] 2.7.9 以及上版本的 python 安装程序会自动安装 pip. 升级:pip install --upgrade pip. 使用pip安装Jinja2:sudo ...

  6. MySQL8 重置改root密码及开放远程访问

    1. 修改配置文件 先修改配置文件:vim /etc/my.conf 在 [mysqld] 下加上下面这行 skip-grant-tables 重启 mysql 服务: service mysqld ...

  7. Ubuntu 16.04中VirtualBox 5.1使用U盘/USB设备的方法

    环境: Ubuntu 16.04 LTS VirtualBox 5.1.26 r118224 虚拟机系统:Windows 7 SP1 64 安装扩展: 在这里下载:(自己注意版本好,版本不匹配安装不成 ...

  8. A计划(BFS)

    A计划 http://acm.hdu.edu.cn/showproblem.php?pid=2102 Time Limit: 3000/1000 MS (Java/Others)    Memory ...

  9. C++中纯虚函数

    1.纯虚函数 virtual ReturnType Function()= 0; 纯虚函数可以让类先具有一个操作名称,而没有操作内容,让派生类在继承时再去具体地给出定义.凡是含有纯虚函数的类叫做抽象类 ...

  10. 设置网站默认用IE7打开

    head中加入以下内容 <meta http-equiv="X-UA-Compatible" content="IE=7" />