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 ...
随机推荐
- Could not resolve placeholder 'CUST_INDUSTORY' in string value "${CUST_INDUSTORY}"
问题描述 项目中的资源文件中写了个properties文件,内容这样的 CUST_FROM=002 CUST_INDUSTORY=001 CUST_LEVEL=006 在springmvc配置文件中加 ...
- java最常用的几种加密算法
1. BASE64 Base64是网络上最常见的用于传输8Bit字节代码的编码方式之一,大家可以查看RFC2045-RFC2049,上面有MIME的详细规范.Base64编码可用于在HTTP环境下传递 ...
- 动态规划——DP算法(Dynamic Programing)
一.斐波那契数列(递归VS动态规划) 1.斐波那契数列——递归实现(python语言)——自顶向下 递归调用是非常耗费内存的,程序虽然简洁可是算法复杂度为O(2^n),当n很大时,程序运行很慢,甚至内 ...
- Codeforces-348E Pilgrims
#4342. CF348 Pilgrims 此题同UOJ#11 ydc的大树 Online Judge:Bzoj-4342,Codeforces-348E,Luogu-CF348E,Uoj-#11 L ...
- 新手玩ubuntu(一)终端
有终端才能行天下事 点击为如下,就可以进行下面的开发了
- 安装postgresql11.5
root身份安装 创建用户 编译安装成功后,接下来要做的就是创建一个普通用户,因为默认超级用户(root)不能启动postgresql,所以需要创建一个普通用户来启动数据库,执行以下命令创建用户: [ ...
- 廖雪峰Java10加密与安全-4加密算法-5非对称加密算法
1.非对称加密 非对称加密就是加密和解密使用的不是相同的密钥 方法1: * 加密:用自己的私钥加密,然后发送给对方:encrypt(privateKeyA, message)->s * 解密:对 ...
- exit()和return语句的区别
(1)exit用于结束正在运行的程序,exit函数将参数是返回给OS.而return是返回函数值并退出函数. (2)return是语言级别的,它表示了调用堆栈的返回:而exit是系统调用级别的,它表示 ...
- Django项目:CMDB(服务器硬件资产自动采集系统)--01--01CMDB获取服务器基本信息
AutoClient #settings.py # ————————01CMDB获取服务器基本信息———————— import os BASEDIR = os.path.dirname(os.pat ...
- fork 与 vfork
fork 函数复制父进程(包括父进程的地址空间)产生子进程 在父进程返回子进程ID,在子进程本身返回0. fork一般有两个用处: 1.网络服务进程等待请求,新请求到来,fork一个子进程处理,父进程 ...