I have a controller
package com.controller;
@Controller
public class MyController{
@Autowired
private ISessionHolder holder;
}
In my config xml
:
<context:component-scan base-package="com.*" />
<bean id="sessionholder" class="com.session.SessionHolder" scope="session">
<aop:scopedProxy/>
</bean>
However I get the exception
no matching bean found for type ISessionHolder used in MyController.
But if i remove the bean definition for the sessionholder in the XML and annotate, it works fine.
@Component
@ScopedProxy
public class SessionHolder{
//
}
Are annotated classes instantiated first Or is there a specific order?