出错原因
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>
分享到:
相关推荐
java解决Handler processing failed; nested exception is java.lang.NoClassDefFoundError
java解决nested exception is java.lang.OutOfMemoryError Java heap space 解决OOM
nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'transactionManagerBeanName' of bean class [org.springframework.transaction.interceptor....
nested exception is com.sun.jersey.api.client.UniformInterfaceException: PUT http://localhost:8090/picServer/uploads/QQ截图20200220003029.png returned a response status of 400 Bad Request type ...
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController' defined in ServletContext resource [/WEB-INF/springMVC-servlet.xml]: Error ...
nested exception is org.springframework.core.NestedIOException: Failed to parse config resource: class path resource [mybatis- config.xml]; nested exception is org.apache.ibatis.builder....
nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator]: ...
dbcp 连接池不合理的锁导致连接耗尽解决方案 ... nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted at org.springframework.jdbc.dataso
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure...
主要介绍了Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法的相关资料,需要的朋友可以参考下
NULL 博文链接:https://bijian1013.iteye.com/blog/2305804
严重: Exception sending context initialized event to listener instance ... nested exception is java.lang.NoClassDefFoundError: org/objectweb/asm/Type ssh 框架的java web项目部署到tomcat报上面错误 添加此包
若依整合Ureport2导出报表提示 Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/poi/POIXMLTypeLoader 的解决文档说明
<groupId>com.squareup.okio</groupId> <artifactId>okio <version>2.8.0</version>
Java面向对象测试试题(经典).doc
本人之前学习Spring的一些整理,为SpringMVC的思维导图,具体markdown还在编写中,写文档真的是太脑壳疼了,不过看着写好的文档还是挺舒服的,一起学习吧.
搜集整理关于java错误处理:java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space 资料整理
oracle实例的内存(SGA和PGA)进行调整,优化数据库性
内容概要:本电商系统主要使用ASP.NET技术+BootStrap前端框架+SQLServer数据库,通过对该系统的设计,简化代码实现过程,保留核心功能,可以在实践过程中掌握ASP.NET技术的部分使用方法,如对三层架构开发模式的熟悉...
nested exception is org.hibernate.exception.SQLGrammarException: could not execute query 我的SSH项目原本使用的sqlserver2005数据库现在改用MySql。我改了applicationcontex的配置,我运行了就出现上面的...