使用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. SQL Server 为存储过程添加预定设置注释代码

    一个优秀的项目最少不了的是代码注释,兴许你是代码高手入目既知道该段代码主要功能是什么,但日子长了,记的东西多了,即时再熟悉的代码也渐渐的有点不认 识它,所以养成良好的写注释的习惯,对于自己对于他人都是 ...

  2. bzoj 2632 [neerc2011]Gcd guessing game——贪心(存疑)

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2632 官方题解:http://neerc.ifmo.ru/archive/2011/neer ...

  3. jdk1.8新特性之函数式接口

    函数式接口就是只有一个抽象方法的接口.如果这个接口里没有或者包含了两个以上的抽象方法,对不起,你不叫函数式接口,只能叫你接口.那这个函数式有啥用呢?如果配合Lambda表达式的话,可以大大的简化代码. ...

  4. 嵌入式设备snmpd 移植和测试(78K为例)

    一.源码目录项内容 agent:编译snmpd程序所需的文件,mibs源文件: apps:其他相关的程序:snmpwalk,snmptrap,snmptest,snmpget,snmpset: mib ...

  5. (转)Inno Setup入门(二十一)——Inno Setup类参考(7)

    本文转载自:http://blog.csdn.net/yushanddddfenghailin/article/details/17268435 复选框 复选框(CheckBox)用于多个并不互斥的几 ...

  6. Form 总结

    禁止input自动完成下拉 //ie: autocomplete="off" //ff: disableautocomplete <input size="40&q ...

  7. 【转】JMeter技巧集锦

    JMeter是一个流行的用于负载测试的开源工具,具有许多有用的功能元件,如线程组(threadgroup),定时器(timer),和HTTP取样(sampler)元件.本文是对JMeter用户手册的补 ...

  8. sklearn: TfidfVectorizer 中文处理及一些使用参数

    TfidfVectorizer可以把原始文本转化为tf-idf的特征矩阵,从而为后续的文本相似度计算,主题模型,文本搜索排序等一系列应用奠定基础.基本应用如: #coding=utf-8 from s ...

  9. Java-Runoob-面向对象:Java 接口

    ylbtech-Java-Runoob-面向对象:Java 接口 1.返回顶部 1. Java 接口 接口(英文:Interface),在JAVA编程语言中是一个抽象类型,是抽象方法的集合,接口通常以 ...

  10. linux下进程cpu占用过高问题定位方法

    背景 记得前段时间,同事说他们测试环境的服务器cpu使用率一直处于100%,本地又没有什么接口调用,为什么会这样?cpu使用率居高不下,自然是有某些线程一直占用着cpu资源,那又如何查看占用cpu较高 ...