nested exception is org.hibernate.MappingException解决方案
1.可能是因为映射文件( Order.hbm.xm)配置的class路径出错
- <hibernate-mapping>
- <class name="com.web.bean.Order" table="order">
- <id name="orderId" type="java.lang.Integer" column="order_id">
- <generator class="increment"></generator>
- </id>
- <property name="price" type="double" column="order_price" length="12"></property>
- <property name="quantity" type="int" column="order_quantity"></property>
- <property name="date" type="date" column="date" length="10"></property>
- <many-to-one name="seller" column="seller_id" class="com.web.bean.Seller"
- not-null="true">
- </many-to-one>
- <many-to-one name="phone" column="phone_id" class="com.web.bean.Phone"
- not-null="true">
- </many-to-one>
- <many-to-one name="customer" column="customer_id" class="com.web.bean.Customer"
- not-null="true">
- </many-to-one>
- </class>
- </hibernate-mapping>
类的路径必须写全,或者在<hibernate-mapping>中加上属性package="com.web.bean"
2.如果以上检查都是对的,那么就看applicationContext.xml中是否加上了
<value>com/web/bean/Order.hbm.xml</value>
- <property name="mappingResources">
- <list>
- <value>com/web/bean/Customer.hbm.xml</value>
- <value>com/web/bean/Seller.hbm.xml</value>
- <value>com/web/bean/Brand.hbm.xml</value>
- <value>com/web/bean/Kind.hbm.xml</value>
- <value>com/web/bean/Order.hbm.xml</value>
- <value>com/web/bean/Phone.hbm.xml</value>
- <value>com/web/bean/SellerOwnPhone.hbm.xml</value>
- </list>
- </property>
nested exception is org.hibernate.MappingException解决方案的更多相关文章
- spring 整合hibernate注解时候,出现“Unknown entity: com.ssh.entry.Admin; nested exception is org.hibernate.MappingException: Unknown entity: com.ssh.entry.Admin”异常的问题
今天学习使用ssh框架的时候,出现一个异常,弄了好久才找到,在这记录一下,我的sb错误1.spring整合hibernate,取代*.hbm.xml配置文件 在applicationContext ...
- Spring Boot启动 Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not instantiate id generator错误
开始运行得很好的项目,因为前一天高度了项目结构和名称突然报上面的错误 查了很多网上资料很多解决方案 造成这个错误的原因有很多,例如 1.@Entity 类有变动,无非正常生成对应的数据库. 解决:使用 ...
- org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist: sys.entity.Role; nested exception is org.hibernate.PersistentObjectException: 的解决方案
1.错误信息 org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist ...
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
原因: 这个问题的解决方案很简单,主要是因为数据库中不存在相关的表或者列. org.springframework.dao.InvalidDataAccessApiUsageException: Pa ...
- nested exception is org.hibernate.QueryException: could not resolve property
SSH框架出现了下面的错误: nested exception is org.hibernate.QueryException: could not resolve property 检查了hbm.x ...
- Invocation of init method failed; nested exception is org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl
严重: Exception sending context initialized event to listener instance of class org.springframework.we ...
- HTTP Status 500 - Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement
1.什么操作出现:当我在项目中添加产品或者修改时,浏览器出现HTTP Status 500 - Request processing failed; nested exception is org.h ...
- org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open con
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session f ...
- 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 ...
随机推荐
- 引用不了XXservice,怎么办?
1.tEdasArchiveLogService = (TEdasArchiveLogService) SpringContextHolder.getBean("TEdasArchiveLo ...
- linux操作mysql命令快速手记 — 让手指跟上思考的速度(二)
这一篇是<mysql内建命令快速手记>的姐妹篇,废话不再赘述,直接上干货,跟老铁慢慢品 1.mysql -hlocalhost -uroot -proot,-h,-u,-p分别代表ip,u ...
- JS基础语法之DOM02(事件)
1.常用事件 1.onclick 单击 应用场景:为按钮绑定 2.ondbclick 双击 3.onfocus 获得焦点 4.onblur 失去焦点 应用场景:用于表单验证,用户离开某个输入框时, ...
- 使用Windows任务计划程序和Python备份Mysql数据库
目标:每日定时自动备份Mysql数据库 方案: 1.安装Python: 使用的Python版本是Python3.7.1,下载地址:https://www.python.org/downloads/re ...
- 最新二进制安装部署kubernetes1.15.6集群---超详细教程
00.组件版本和配置策略 00-01.组件版本 Kubernetes 1.15.6 Docker docker-ce-18.06.1.ce-3.el7 Etcd v3.3.13 Flanneld v0 ...
- elasticsearch java 索引操作
1.添加maven依赖 <dependency> <groupId>org.elasticsearch</groupId> <artifactId>el ...
- 网络结构解读之inception系列二:GoogLeNet(Inception V1)
网络结构解读之inception系列二:GoogLeNet(Inception V1) inception系列的开山之作,有网络结构设计的初期思考. Going deeper with convolu ...
- [Hdu-6053] TrickGCD[容斥,前缀和]
Online Judge:Hdu6053 Label:容斥,前缀和 题面: 题目描述 给你一个长度为\(N\)的序列A,现在让你构造一个长度同样为\(N\)的序列B,并满足如下条件,问有多少种方案数? ...
- 4、uboot对设备树的支持
第01节_传递dtb给内核 : r2 a. u-boot中内核启动命令: bootm <uImage_addr> // 无设备树,bootm 0x30007FC0 bootm <uI ...
- 廖雪峰Java10加密与安全-4加密算法-2口令加密算法
对称加密key是一个byte数组,如AES256算法的key是一个32字节的数组,普通的加密软件由用户输入加密口令.如果由用户输入口令,进行加密/解密,需要用到PBE算法. 1.PBE:Passwor ...