Are you sure your bean is named "personsManager" and not "personManager"?
Matt On 12/25/07, sudheerp <[EMAIL PROTECTED]> wrote: > > Hello, > > *** MERRY CHRISTMAS TO ALL *** > > I am using appfusejsf 1.9.4. I have written a custom JSF validator, > in which I want to validate form data against the database data. > > <h:inputText styleClass="text small" id="toDate" > value="#{personsForm.persons.toDate}"> > <f:convertDateTime pattern="#{text['date.format']}"/> > <f:validator validatorId="dcbooks.personToDateValidator"/> > <f:attribute name="fromDateObject" value="personsForm:fromDate"/> > <a4j:support event="onchange" reRender="toDateMessage"/> > </h:inputText> > > For this I want to get a bean programatically by using > getBean("personsManager"), > and I tried the following method. > > String[] path = { "classpath*:META-INF/applicationContext-resources.xml," > + > "classpath*:META-INF/applicationContext-service.xml," + > "classpath*:META-INF/applicationContext-hibernate.xml" > }; > ApplicationContext applicationContext = new > ClassPathXmlApplicationContext(path); > PersonsManager personManager = (PersonsManager) > applicationContext.getBean("personsManager"); > > But getting the following error: > > [dcbooks] ERROR [http-8080-Processor25] [faces].invoke(250) | > Servlet.service() for servlet faces threw exception > org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean > named 'personsManager' is defined > at > org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:355) > at > org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:800) > > > How to solve this issue ? > > Thank you. > > -- > View this message in context: > http://www.nabble.com/How-to-get-a-reference-to-a-manager-in-a-custom-validator-tp14496212s2369p14496212.html > Sent from the AppFuse - User mailing list archive at Nabble.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]