could not determine type for java.util.set

本文详细介绍了在使用Hibernate时遇到的一个常见问题:由于bean.hbm.xml配置文件中kehu_items字段配置重复导致的类型识别错误。通过分析错误日志和配置细节,最终成功定位并修复了问题。
出现这个问题竟然是因为我的 bean.hbm.xml  配置文件中kehu_items字段写重复了,写了两个,因为字段太多了没看出来,纠结了好久 ,终于解决了

<property name="kehu_items"/>

<set name="kehu_items" table="person_kehuItem" lazy="false">
            <key column="bianhao"/>
            <many-to-many class="com.bean.Kehu_item" column="id"/>
        </set>

[2014-05-16 14:03:46,768] ERROR com.util.HibernateSessionFactory.http-bio-8080-exec-3(HibernateSessionFactory.java:68) - Could not determine type for: java.util.Set, for columns: [org.hibernate.mapping.Column(kehu_items)]

org.hibernate.MappingException: Could not determine type for: java.util.Set, for columns: [org.hibernate.mapping.Column(kehu_items)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:253)
at org.hibernate.mapping.Property.isValid(Property.java:185)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:395)
at org.hibernate.mapping.RootClass.validate(RootClass.java:192)
at org.hibernate.cfg.Configuration.validate(Configuration.java:984)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1169)
at com.util.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:66)
at com.util.HibernateSessionFactory.getSession(HibernateSessionFactory.java:49)
at com.DAO.PersonDAOImpl.getPages(PersonDAOImpl.java:23)
at com.action.UserManageAction.login(UserManageAction.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:30)
at
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值