reset password
Author Message
jgreen
Posts: 23
Posted 15:05 Nov 01, 2009 |

Hi,

i am getting an error that says

 Invalid property 'onlineAssignmentDao' of bean class [csns.spring.controller.CreateAssignmentController]: No property 'onlineAssignmentDao' found

In CreateAssignmentController.java I have this:

    private OnlineAssignmentDao onlineAssignmentDao;

It has a getter and a setter.

And in spring-servlet.xml within the bean for this class I have:

        <property name="onlineAssignmentDao" ref="onlineAssignmentDao" />

 

And I have the onlineAssignmentDao bean declared as well.

How come it can't find the property?  The error sounds like it can't find it somewhere within CreateAssignmentController.java, but it is there...

Thanks.

 

Last edited by jgreen at 15:05 Nov 01, 2009.
cysun
Posts: 2935
Posted 15:09 Nov 01, 2009 |

Check the spellings.

jgreen
Posts: 23
Posted 15:31 Nov 01, 2009 |

I have checked the spellings, and now I added a UserDao property to test it and that property was not found either.  Would it be correct to assume that it is having problems finding the CreateAssignmentController class?  or would that be a different error?

cysun
Posts: 2935
Posted 15:39 Nov 01, 2009 |

Please copy&paste the full stack trace here so I can have a look.

jgreen
Posts: 23
Posted 16:00 Nov 01, 2009 |

SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'urlMapping1' defined in ServletContext resource [/WEB-INF/csns-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/assignment/NewAssignment.html' defined in ServletContext resource [/WEB-INF/csns-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'onlineAssignmentDao' of bean class [csns.spring.controller.CreateAssignmentController]: No property 'onlineAssignmentDao' found
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
    at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
    at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
    at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
    at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
    at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

cysun
Posts: 2935
Posted 16:13 Nov 01, 2009 |

The only possible reason I can think of is that for some reason Eclipse is not getting the changes you made to the CreateAssignmentController class. In the Servers view, right click on csns then "Clean Module Work Directory ...". Then refresh the project and try running it again.

jgreen
Posts: 23
Posted 19:18 Nov 01, 2009 |

I assume that was the problem as well. While the above advice did not work, I ended up just moving on and writing another bean.  In the process, I refreshed the project a bunch of times and at some point it stopped giving me that error and ran.  Thanks for your help.