On 12/9/07, DM <[EMAIL PROTECTED]> wrote: > Hi, > > I've been following along with the tutorial, but whenver I run the tests or > try to deploy the application I'm getting the following error: > > ------------------------------------------- > testHandleRequest(org.appfuse.webapp.controller.PersonControllerTest) Time > elapsed: 3.437 sec <<< ERROR! > org.springframework.beans.factory.BeanCreationException: Error creating bean > with name 'personController' defined in ServletContext resource > [/WEB-INF/dispatcher-servlet.xml]: Error setting property values; nested > exception is org.springframework.beans.NotWritablePropertyException: Invalid > property 'validator' of bean class > [org.appfuse.webapp.controller.PersonController]: Bean property 'validator' > is not writable or has an invalid setter method. Does the parameter type of > the setter match the return type of the getter? > at > org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1303) > ------------------------------------------- > > So I checked my beans in dispatcher-servlet.xml and found the following: > > <bean id="personController" > class="org.appfuse.webapp.controller.PersonController"> > <property name="personManager" ref="personManager"/> > </bean> > > <bean id="personFormController" > class="org.appfuse.webapp.controller.PersonFormController"> > <property name="validator" ref="beanValidator"/> > <property name="successView" value="redirect:persons.html"/> > <property name="personManager" ref="personManager"/> > </bean> > > > As you can see personController does not define a validator property (though > personFormController does), so I don't understand why Spring is complaining > that the PersonController class does not have a setter method for this > property. > > I think I might have previously defined the validator method on > personController, but then moved it to personFormController after I realised > my mistake. So it's possible that Spring is picking up a previous version of > this file, which is causing this problem.
Yes, this is possible - I'd make sure you're editing the right file and make sure to run "mvn clean". Matt > > Thanks in advance, > Don > > > ___________________________________________________________ > Yahoo! Answers - Got a question? Someone out there knows the answer. Try it > now. > http://uk.answers.yahoo.com/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
