当前位置: 代码迷 >> Java Web开发 >> hibernate.cfg.xml 加载映射文件有,tomcat无法启动解决思路
  详细解决方案

hibernate.cfg.xml 加载映射文件有,tomcat无法启动解决思路

热度:335   发布时间:2016-04-17 10:26:57.0
hibernate.cfg.xml 加载映射文件有,tomcat无法启动
<property name="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</property>
<property name="hibernate.show_sql">true</property>
<mapping resource="com/pro/models/Users.hbm.xml" />
<mapping resource="com/pro/models/Admin.hbm.xml" />
<mapping resource="com/pro/models/Car.hbm.xml" />
<mapping resource="com/pro/vo/UsercarCar.hbm.xml" /> //加入这一行就会出错,这个是视图

出错信息:
 ERROR (org.springframework.web.context.ContextLoader:215) - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext_user.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

UsercarCar.hbm.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- 
  Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping package="com.pro.vo">
  <class name="UsercarCar" table="usercarcar" lazy="false">
   
  <id name="mid">
<generator class="native"></generator>
  </id>
  <property name="carid" type="java.lang.String">
  <column name="carid" length="50" />
  </property>
  <property name="userid" type="java.lang.String">
  <column name="userid" length="50" />
  </property>
  <property name="gpssn" type="java.lang.String">
  <column name="gpssn" length="12" />
  </property>
  <property name="minv" type="java.lang.Short">
  <column name="minv" />
  </property>
  <property name="sim" type="java.lang.String">
  <column name="sim" length="50" />
  </property>
  <property name="creattime" type="java.sql.Timestamp">
  <column name="creattime" length="23" />
  </property>
  <property name="authphones" type="java.lang.String">
  <column name="authphones" length="50" />
  </property>
  <property name="rectregions" type="java.lang.String">
  <column name="rectregions" length="50" />
  </property>
  <property name="name" type="java.lang.String">
  <column name="name" length="50" />
  </property>
  <property name="location" type="java.lang.String">
  <column name="location" length="50" />
  </property>
  <property name="gprsLasttime" type="java.sql.Timestamp">
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!
 
  • 最近登录:Thu Sep 20 17:40:36 CST 2018
  • 最近登录:Thu Sep 20 17:40:36 CST 2018
  • 最近登录:Thu Sep 20 17:40:36 CST 2018
  • 最近登录:Thu Sep 20 17:40:36 CST 2018
  • 最近登录:Thu Sep 20 17:40:36 CST 2018