1. 程式人生 > >SSH框架問題——hbm.xml配置出現的org.hibernate.MappingException: Could not determine type for:(貌似叫資料型別轉換錯誤)問題

SSH框架問題——hbm.xml配置出現的org.hibernate.MappingException: Could not determine type for:(貌似叫資料型別轉換錯誤)問題

不知道大家有沒有碰到過這樣一個報錯:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDaoImp': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for:  java.lang.String, at table: tb_user, for columns: [org.hibernate.mapping.Column(CREATETIME)]

因為我用的是註解的方式,因此開始所有的懷疑都在註解是不是有問題上,一直搞了一天,看到了這篇部落格http://blog.csdn.net/qingtanlang/article/details/2497479,才發現自己的問題也是這個我是在<property name="createTime" type=" java.sql.Timestamp">這個地方,type=" "前面多寫了一個空格……刪掉後,糾結了一天的問題終於解決了,再次感謝同學!