Hibernate错误:Unable to instantiate default tuplizer

Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:108)
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:133)
    at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:80)
    at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:322)
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:473)
    at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:133)
    at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:84)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:284)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
    at util.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:15)
    ... 1 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:105)
    ... 10 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for wineClass in class model.WineClass
    at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:326)
    at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:320)
    at org.hibernate.mapping.Property.getGetter(Property.java:304)
    at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:297)
    at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:155)
    at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:77)

    ... 15 more

第一种情况:查阅资料说是缺少javassist.jar,而我的这个包是绝对没错的,重新加载了一还是不行。

第二种情况:查看映射文件,突然发现Could not find a getter for wineClass in class model.WineClass所以明白了,属性没有对应,说明映射文件和模型类中的属性对应有错,于是解决。

展开阅读全文

Hibernate (Unable to instantiate default tuplizer [org.hibernate.tuple.entity.Po

12-02

错误:Initial SessionFactory creation failed.org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]rn2011-12-2 0:50:53 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet NewContactServlet threw exceptionrnjava.lang.NullPointerExceptionrnrn我在网上查了很多,因为我的程序在改动之前是可以运行的,所以不存在少什么东西之类的,应该就是实体类中的XX属性和getXX方法对不上,这类的问题,但是我查了很久都不知道哪错了,再加上这块比较不熟……希望大家指正一下,最好能详细点,纯新手。谢谢rnrnPhoneNumber.hbp.xmlrnrnrnrnrn rn rn rn rn rn rn rn rn rnrnrnPhoneNumber.javarnrnpublic class PhoneNumber rn rn long id_phone;rn String phoneKind;rn String phoneNumber;rn// String phoneKind2;rn// String phoneNumber2;rn// String phoneKind3;rn// String phoneNumber3;rn Contact contact;rn rn public PhoneNumber()rn rn rnrn public PhoneNumber(String phoneKind, String phoneNumber) rn super();rn this.phoneKind = phoneKind;rn this.phoneNumber = phoneNumber;rnrn rnrn public long getid_phone() rn return id_phone;rn rnrn public void setid_phone(long id_phone) rn this.id_phone = id_phone;rn rnrn public String getPhoneKind() rn return phoneKind;rn rnrn public void setPhoneKind(String phoneKind1) rn this.phoneKind = phoneKind1;rn// this.phoneKind2 = phoneKind2;rn// this.phoneKind3 = phoneKind3;rn rnrn public String getPhoneNumber() rn return phoneNumber;rn rnrn public void setPhoneNumber(String phoneNumber1) rn this.phoneNumber = phoneNumber1;rn// this.phoneNumber2 = phoneNumber2;rn// this.phoneNumber3 = phoneNumber3;rn rn rn rn public Contact getContact() rn return contact;rn rnrn public void setContact(Contact contact) rn this.contact = contact;rn rnrnrnContact.hbp.xmlrnrnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrn相关的问价大概就是这些……希望大家能抽时间看看,谢谢!rn 论坛

Unable to instantiate default tuplizer这个错误

04-17

[code=Java]Exception in thread "main" org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.component.PojoComponentTuplizer]rn at org.hibernate.tuple.component.ComponentTuplizerFactory.constructTuplizer(ComponentTuplizerFactory.java:101)rn at org.hibernate.tuple.component.ComponentTuplizerFactory.constructDefaultTuplizer(ComponentTuplizerFactory.java:122)rn at org.hibernate.tuple.component.ComponentEntityModeToTuplizerMapping.(ComponentEntityModeToTuplizerMapping.java:75)rn at org.hibernate.tuple.component.ComponentMetamodel.(ComponentMetamodel.java:73)rn at org.hibernate.mapping.Component.buildType(Component.java:175)rn at org.hibernate.mapping.Component.getType(Component.java:168)rn at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:276)rn at org.hibernate.mapping.RootClass.validate(RootClass.java:216)rn at org.hibernate.cfg.Configuration.validate(Configuration.java:1149)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1334)rn at com.me.text.MainText.add(MainText.java:14)rn at com.me.text.MainText.main(MainText.java:11)rnCaused by: java.lang.reflect.InvocationTargetExceptionrn at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)rn at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)rn at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)rn at java.lang.reflect.Constructor.newInstance(Constructor.java:513)rn at org.hibernate.tuple.component.ComponentTuplizerFactory.constructTuplizer(ComponentTuplizerFactory.java:98)rn ... 11 morernCaused by: org.hibernate.PropertyNotFoundException: Could not find a getter for email in class com.me.one_to_many.Emailrn at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:306)rn at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:299)rn at org.hibernate.mapping.Property.getGetter(Property.java:294)rn at org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:156)rn at org.hibernate.tuple.component.AbstractComponentTuplizer.(AbstractComponentTuplizer.java:66)rn at org.hibernate.tuple.component.PojoComponentTuplizer.(PojoComponentTuplizer.java:61)rn ... 16 morern[/code]rnjavassist.jar已经加上rnrnrnrnrnrn第一次运行的时候还正常的,后面就出上面的错误了! 论坛

使用hibernate annotation在继承过程中出现Unable to instantiate default tuplizer,找了一天都没找到问题

03-29

请教高手CompanyCustomer从Customer继承,但是启动tomcat6的时候出现Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer],不知道是怎么回事?多谢rnCustomer.javarnrn@Entityrn@Inheritance(strategy=InheritanceType.SINGLE_TABLE)rn@DiscriminatorColumn(rn name="discriminator",rn discriminatorType=DiscriminatorType.STRINGrn)rn@DiscriminatorValue("customer")rnpublic class Customer rn rn private int id;rn private Customer parent;rnrn public String getCategory()rn return "未知";rn rnrn @Idrn @GeneratedValuern public int getId() rn return id;rn rnrn public void setId(int id) rn this.id = id;rn rn rn @ManyToOnern @JoinColumn(name="pid")rn public Customer getParent() rn return parent;rn rnrn public void setParent(Customer parent) rn this.parent = parent;rn rnrnrnrnrnCompanyCustomer.javarn@Entityrn@DiscriminatorValue("company")rnpublic class CompanyCustomer extends Customer rn rn //人员规模rn private String employeeSize;rn rn @Column(insertable=false,updatable=false)rn public String getCategory()rn return "公司";rn rn rn public String getEmployeeSize() rn return employeeSize;rn rnrn public void setEmployeeSize(String employeeSize) rn this.employeeSize = employeeSize;rn rnrnrnrnError creating bean with name 'sessionFactory' defined in class path resource [beans.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]rnCaused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]rnCaused by: java.lang.reflect.InvocationTargetExceptionrnCaused by: org.hibernate.PropertyNotFoundException: Could not find a setter for property category in class com.wdl.crm.model.PersonalCustomerrnrn不写这一句@Column(insertable=false,updatable=false)rn则会出现重复映射的问题,不知道怎么解决,找了一天都没找到问题出在哪里,和没有setCategory方法没关系,因为我在父类和子类把getCategory方法都去掉也报同样的错误 论坛

没有更多推荐了,返回首页