Announcement Announcement Module
No announcement yet.
context initialised failed Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • context initialised failed

    hey guys,

    i am just a beginner in spring and doing it as part of my uni research assignment.

    the link below points to a simple application using spring mvc

    doing the example - i get the following error:

    Context initialization failed
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name ' ollerClassNameHandlerMapping#0' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'controller.HelloController#0' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Cannot resolve reference to bean 'HelloService' while setting bean property 'helloService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'HelloService' is defined
    at AutowireCapableBeanFactory.doCreateBean(AbstractAu
    at AutowireCapableBeanFactory$
    at Method)
    at .......

    um badly stuck ...

    how can i fix it any suggestions... the code is given on the above url to check what exactly um doing...

    please help


  • #2
    Have you declared you 'helloService' bean as
    <bean name="HelloService" class="service.HelloService" />
    instead of (case of helloService)
    <bean name="helloService" class="service.HelloService" />


    • #3
      Just to make this really clear for you ..........
      Well it seems to me that you have something like this
      <bean id="HelloController" class="com....HelloController">
      <property name ="helloService" ref="HelloService"/>
      So your controller gets invoked and fails at the line where this HelloService is reffered.
      Please check if a stament like this exists in your bean definition file :
      <bean id="HelloService" class="com....HelloService"/>
      I hope this should make it really clear to what you need to do to fix this issue.