使用Hibernate 插入List数据时出现了以下异常:

 SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:110)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:135)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:323) at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:456)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:131)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:267)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
at com.bdqn.entity.test.Test.setPics(Test.java:315)
at com.bdqn.entity.test.Test.setPhones(Test.java:341)
at com.bdqn.entity.test.Test.main(Test.java:67)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:107)
... 11 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for phones in class com.bdqn.entity.User
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:306)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:299)
at org.hibernate.mapping.Property.getGetter(Property.java:294)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:300)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:141)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:78)
... 16 more

根据异常信息中的提示:Could not find a getter for phones in class com.bdqn.entity.User

原因:发现是由于实体类中,使用的属性方法的get和set方法名方法名称的问题!属性为phones,而方法是setPhone(),getPhone(),get和set之后的单词与属性不一致

解决方法:删除原先的set和get方法,重新生成即可!

org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]的更多相关文章

  1. HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTup

    Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.t ...

  2. Hibernate 异常 —— Unable to instantiate default tuplize

    出现这个异常 —— Unable to instantiate default tuplizer ,是 Hibernate 的映射文件(*.hbm.xml)导致的.仔细检查一下工程里的映射文件吧. 笔 ...

  3. 使用hibernate时出现 org.hibernate.HibernateException: Unable to get the default Bean Validation factory

    hibernate 在使用junit测试报错: org.hibernate.HibernateException: Unable to get the default Bean Validation ...

  4. juit测试中报错:org.hibernate.HibernateException: Unable to get the default Bean Validation factory

    org.hibernate.HibernateException: Unable to get the default Bean Validation factory 解决方法: 解决方案: 在hib ...

  5. Spring JUnit org.hibernate.HibernateException: Unable to get the default Bean Validation factory

    org.hibernate.HibernateException: Unable to get the default Bean Validation factory <property nam ...

  6. Caused by: org.hibernate.HibernateException: Unable to build the default ValidatorFactory

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testAction': ...

  7. org.hibernate.HibernateException: Unable to get the default Bean Validation factor

    org.hibernate.HibernateException: Unable to get the default Bean Validation factor这个异常需要在hibernate.c ...

  8. 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 ...

  9. org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto ...

随机推荐

  1. 接口测试基础——第7篇 Python中_、__、__func__之间的区别

    今天的东西很少,主要是给自己做个笔记,顺便帮大家普及一下Python中的边角知识: 1.if __name__ == "__main__"是什么意思 答:一个.py文件,如果是自身 ...

  2. win32 去掉窗口边框

    参考:http://www.blitzbasic.com/Community/posts.php?topic=67222 Strict Graphics 320, 200 SetClsColor 0, ...

  3. python当前路径

    os.getcwd()获取系统路径 sys.path [0]获取当前路径

  4. 记录一些WPF常用样式方便以后复用(转)

    TextBox文本框 <Style x:Key="TextBoxStyle1" BasedOn="{x:Null}" TargetType="{ ...

  5. ballerina 学习十 streams

    ballerina 的streams 使用的是siddhi complex event processing 引擎处理,可以包含的语法有 projection filtering windows jo ...

  6. homeland 开源论坛系统搭建试用

    备注: 需要使用docker docker-compose   1. clone 代码 git clone https://github.com/ruby-china/homeland-docker. ...

  7. ubuntu12.04安装KDevelop

    1, sudo apt-get update 2, sudo apt-get install kdevelop

  8. 通过Authentication Challenge来信任自签名Https证书

    在开发阶段我们我们经常使用自签名的证书来部署我们的后台rest api.但是在iOS中调用的时候就会因为证书不被信任而调用api不成功.这时候我们就需要通过实现某些网络回调函数来自定义证书的验证逻辑. ...

  9. Android screencap截屏指令

    查看帮助(注意:有的网友错误使用 screencap -v ,结果差不多,因为系统不能识别-v,就自动打印出帮助信息) # screencap -hscreencap -husage: screenc ...

  10. pandas之DateFrame 数据过滤+遍历行+读写csv-txt-excel

    # XLS转CSV df = pd.read_excel(r'列表.xls') df2 = pd.DataFrame()df2 = df2.append(list(df['列名']), ignore_ ...