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 ...
随机推荐
- idea 开始java之旅
1.安装idea 2018.3.5 https://www.jetbrains.com/idea/ 2.破解安装教程 https://blog.csdn.net/qq_34668897/article ...
- Django之框架简介
了解即可: 1.MVC,全名是Model View Controller,是软件工程中的一种软件架构模式,把软件系统分为三个基本部分:模型(Model).视图(View)和控制器(Controller ...
- Angularjs 1 使用filter格式化输出href
Angularjs版本: 1.3.5 工作中,由于是多级菜单,如果上级菜单为空,就会访问Angularjs 默认的state,然后再展开菜单,我找资料之后,才知道是通过filter来格式化输出数据的, ...
- 延迟对象deferred
Twisted 官方称,“Twisted is event-based, asynchronous framework ”.这个“异步”功能的代表就是 deferred. deferred 的作用类似 ...
- 后缀数组(SA)及height数组
最近感觉自己越来越蒟蒻了--后缀数组不会,费用流不会-- 看着别人切一道又一道的题,我真是很无奈啊-- 然后,我花了好长时间,终于弄懂了后缀数组. 后缀数组是什么? 后缀SASASA数组 给你一个字符 ...
- 阿里云 Aliplayer高级功能介绍(八):安全播放
基本介绍 如何保障视频内容的安全,不被盗链.非法下载和传播,阿里云视频点播已经有一套完善的机制保障视频的安全播放: 更多详细内容查看点播内容安全播放,H5的Aliplayer对于上面的安全机制都是支持 ...
- leyou_06——FastDFS在Nginx下的安装与测试
1.FastDFS FastDFS是由淘宝的余庆先生所开发的一个轻量级.高性能的开源分布式文件系统.用纯C语言开发,功能丰富: 文件存储 文件同步 文件访问(上传.下载) 存取负载均衡 在线扩容 2. ...
- scp免密码拉去方法
# scp命令免密码vi /etc/hosts.allow新增行sshd:61.174.9.92:allow 拷贝/root/.ssh/id_rsa.pub到备份机,重命名为/root/.ssh/au ...
- linux负载均衡(什么是负载均衡)
linux负载均衡(什么是负载均衡) 一.总结 一句话总结: 建立在现有网络结构之上,它提供了一种廉价有效透明的方法扩展网络设备和服务器的带宽.增加吞吐量.加强网络数据处理能力.提高网络的灵活性和可用 ...
- 166 链表倒数第n个结点
原题网址:https://www.lintcode.com/problem/nth-to-last-node-in-list/description 描述 找到单链表倒数第n个节点,保证链表中节点的最 ...