org.hibernate.HibernateException: /hibernate.cfg.xml not found等三个问题
初次配置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等三个问题的更多相关文章
- 问题Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not found解决方法
问题Initial SessionFactory creation failed.org.hibernate.HibernateException: /hibernate.cfg.xml not fo ...
- hibernate 使用 hibernate tool 生成配置文件和实体类
安装Hibernate插件 下载所需的Hibernatetools http://www.hibernate.org/6.html 将下载得到的文件解压得到的features和plugins文件夹, ...
- org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml at org.hibernate ...
- hibernate hibernate.cfg.xml component 组件
1.为什么使用component组件? 当一个表的列数目比较多时,可以根据属性分类,将一个java对象拆分为几个对象. 数据库还是一张表,不过有多个对象与之对应. 2.实例 2.1 Java 对象: ...
- 关于Could not parse configuration: /hibernate.cfg.xml的问题
第一次在eclipse上配置hibernate,问题百出啊,比如下面的org.hibernate.HibernateException: Could not parse configuration: ...
- hibernate.cfg.xml配置(Oracle+c3p0)
说明:数据库:Oracle10g:连接池:c3p0 结构: 一.配置hibernate.cfg.xml <?xml version="1.0" encoding=" ...
- 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 ...
- org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xm
org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xm 检查jar包是否正确以及配置的xm ...
- 解决离线Could not parse configuration:hibernate.cfg.xml错误
离线使用hibernate tool 生成反向工程,在配置 配置文件完,生成配置文件后,会报出org.hibernate.HibernateException: Could not parse con ...
随机推荐
- 在mfc中picture控件中显示Mat图片<转>
void ShowMatImgToWnd(CWnd* pWnd, cv::Mat img) { if(img.empty()) return; CRect drect; pWnd->GetCli ...
- UI5-文档-4.14-Custom CSS and Theme Colors
有时我们需要定义一些更细粒度的布局,这时我们可以通过向控件添加自定义样式类来使用CSS的灵活性,并根据自己的喜好对它们进行样式化. Preview The space between the butt ...
- linux查看网卡驱动
[root@hudson ~]# yum install ethtool -y [root@hudson ~]# ethtool -i em1driver: bnx2version: 2.2.3fir ...
- Java操作Excel之Poi
package com.java1234.poi; import java.io.FileOutputStream; import org.apache.poi.hssf.usermodel.HSSF ...
- 基于 tensorflow 的 mnist 数据集预测
1. tensorflow 基本使用方法 2. mnist 数据集简介与预处理 3. 聚类算法模型 4. 使用卷积神经网络进行特征生成 5. 训练网络模型生成结果 how to install ten ...
- Python的isdigit()和isalpha()
提供一个参考链接<isalpha() Method> 使用isdigit()判断是否是全数字: if word.encode( 'UTF-8' ).isdigit() 使用isalpha ...
- maven GroupId 和ArtifactId通常填什么
GroupID是项目组织唯一的标识符,实际对应JAVA的包的结构,是main目录里java的目录结构.ArtifactID就是项目的唯一的标识符,实际对应项目的名称,就是项目根目录的名称.
- localstorage是什么,它有哪些作用
localStorage作为HTML5本地存储web storage特性的API之一,主要作用是将数据保存在客户端中,而客户端一般是指上海网站设计用户的计算机.在移动设备上,由于大部分浏览器都支持 w ...
- Mycat入门及简单规则
以下都来自网络: 官网: http://www.mycat.io/ 官网配置文件解析: https://github.com/MyCATApache/Mycat-Server/wiki/9.0-%E6 ...
- java程序运行时间
方法一 long startTime = System.currentTimeMillis(); //获取开始时间 doSomething(); //测试的代码段 long endTime = Sys ...