Reputation: 412
My application is based on GWT,java,hibernate
I have class Like
public class Test implements Serializable {
private long id;
private String companyName;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
}
Below is my hbm file
Test.hbm.xml:
<property name="id" column="id" type="long"/>
<property name="companyName" column="company_name" type="string"/>
When i tried to debug my application it will throws below error.
org.hibernate.PropertyNotFoundException: Could not find a getter for companyName in class Test
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
at org.hibernate.mapping.Property.getGetter(Property.java:272)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:247)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:125)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:295)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
Its worked fine in one aaplication and gives error in other application.
Can anybody help to resolved this exception?
Upvotes: 1
Views: 2156
Reputation: 423
You can try to clean your project, rebuild and redeploy it. Maybe some changes were not taken into account.
Upvotes: 1