使用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. BZOJ4150 AMPPZ2014 The Staging 【线段树】*

    BZOJ4150 AMPPZ2014 The Staging Description 在舞台上有n个枪手,第i个枪手瞄准了第p[i]个枪手,将于第u[i]秒开枪.一个枪手如果成功开枪, 那么被瞄准的枪 ...

  2. GraphQL和RESTful的区别

    GraphQL和RESTful的区别 http://graphql.cn/learn/ https://www.cnblogs.com/Wolfmanlq/p/9094418.html http:// ...

  3. Making Genome in Berland (DFS+思维)

    个人心得:被这周的专题名坑了,一直用字典树,明明题目看得很清楚了,不存在相同的字母,即每个字母最多只有一个直接后驱,那么只要用DFS走开头就好了, 思想很巧妙,用vector,记录后驱,同时用visi ...

  4. 实用且堪称神器的Chrome插件推荐

    前言 相信很多人都在使用 Chrome 浏览器,其流畅的浏览体验得到了不少用户的偏爱,但流畅只是一方面, Chrome 最大的优势还是其支持众多强大好用的扩展程序(Extensions).最近为了更好 ...

  5. java-文件流正确关闭资源

    用文件流来拷贝一个文件,用到文件字节输入流(FileInputStream)和文件字节输出流(FileOutputStream),用输入流把字节文件读到缓冲数组中,然后将缓冲数组中的字节写到文件中,就 ...

  6. 修改 CentOS 中的 repo

    修改 CentOS 中的 repo 原因 由于安装 odoo 10 太慢,因为服务器是国外的. 修改 进入 repo 文件夹 cd /etc/yum.repos.d/ ls 可以看到所有的源.

  7. java的try-with-resource机制

    在java7之后可以使用try(resource1, resource2){...}这样声明之后,在try{}执行完成之后或者抛异常跳出,都会调用reouce1.close(),resource2.c ...

  8. HL7 Tools suite

    HL7的官网有很多开源工具, 比如:RoseTree,V3Generator,RMIM Designer, Design Repository, V2 & V3 Mapping Tools等. ...

  9. 【Leetcode 338】 Counting Bits

    问题描述:给出一个非负整数num,对[0, num]范围内每个数都计算它的二进制表示中1的个数 Example:For num = 5 you should return [0,1,1,2,1,2] ...

  10. 洗碗机耗材:finish 亮碟 产品的选购

    转发&补充两点 1.亮碟在国内销售的洗涤块是最低端的Classic,二合一产品(理论上必须配合软水盐和亮碟剂).国外很早就淘汰掉Classic级的洗涤块了,当前最低端的是Advanced(四合 ...