Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Object Relational Mapping and the fly likes Tomcat + Spring + Hibernate: PropertyNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Tomcat + Spring + Hibernate: PropertyNotFoundException" Watch "Tomcat + Spring + Hibernate: PropertyNotFoundException" New topic
Author

Tomcat + Spring + Hibernate: PropertyNotFoundException

Bain Kennedy
Greenhorn

Joined: Sep 19, 2002
Posts: 3
net.sf.hibernate.PropertyNotFoundException: Could not find a setter for property id in class Content

The getter and setter methods exist I don't understand why I could be getting this exception... Full stack trace... up ahead:

INFO: Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [propertyConfiguration,myDataSource,mySessionFactory,contentDAO]; Root of BeanFactory hierarchy}
Sep 20, 2004 8:18:11 PM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in resource [/WEB-INF/applicationContext.xml] of ServletContext: Initialization of bean failed; nested exception is net.sf.hibernate.PropertyNotFoundException: Could not find a setter for property id in class com.engagecommerce.models.Content
net.sf.hibernate.PropertyNotFoundException: Could not find a setter for property id in class Content
at net.sf.hibernate.property.BasicPropertyAccessor.getSetter(BasicPropertyAccessor.java:131)
at net.sf.hibernate.mapping.Property.getSetter(Property.java:182)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:577)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:715)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:41)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:750)
at org.springframework.orm.hibernate.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:436)
at org.springframework.orm.hibernate.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:374)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:948)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:284)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:204)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:136)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:203)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:279)
at org.springframework.web.context.support.XmlWebApplicationContext.refresh(XmlWebApplicationContext.java:131)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:156)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:97)
at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:80)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1019)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3991)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4335)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:613)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
at org.apache.catalina.startup.HostConfig.checkContextLastModified(HostConfig.java:830)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1066)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
at java.lang.Thread.run(Thread.java:552)


Any nudge in the right direction would be very helpful...
james edwin
Ranch Hand

Joined: Nov 22, 2001
Posts: 393
Can you post your hbm.xml and Java file too.


Regards,
James
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat + Spring + Hibernate: PropertyNotFoundException