I am developing spring-mvc application.
I am not able to access beans in my filter. I am getting below exception
org.springframework.beans.factory.NoSuchBeanDefinitionException : No qualifying bean of type [com.abc.app.SessionValue] is defined
I went throw https://stackoverflow.com/a/11709272/3898076, but not able to find the problem.
I have below entry in my web.xml
<servlet>
<servlet-name>myapp</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring_xyz-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
And spring_xyz-servlet.xml contains component-scan entry.
<context:component-scan base-package="com.abc.app" />
<context:annotation-config />
<context:spring-configured />
Filter code:
WebApplicationContext springContext = WebApplicationContextUtils.getWebApplicationContext(fConfig.getServletContext());
springContext.getBean(SessionValue.class);
Is there any configuration issue in this?
Thanks.