Hi! Spring seems to resolve and create the autowired objects just fine on boot up. But when I try to access them they come back as null. Anyone have any guesses on what might be going on?
Also XML info is blank as I'm only allowed one hyperlink...
<beans xmlns=""
xmlns:xsi=""
xmlns:p=""
xmlns:mvc=""
xmlns:context=""
xsi:schemaLocation="...only allowed one hyperlink" default-autowire="byName">
<mvc:annotation-driven />
<context:component-scan base-package="com.blah.controller"/>
<context:component-scan base-package="com.blah.*.service"/>
<context:component-scan base-package="com.blah.*.dao"/>
<context:annotation-config />
public class AuthFilter extends UsernamePasswordAuthenticationFilter {
@Autowired
private ProfileService profileService;
//.... Do more stuff below that shows profileService coming back as null.
}
I was able to use a debugger to show that the object was being initialized. I can paste my logs here if you guys want but that's a lot to back edit :).
Adding a bit to this where authfilter is defined:
<b:bean id="authenticationFilter" class="com.blah.auth.AuthFilter">
<b:property name="authenticationManager" ref="authenticationManager" />
<b:property name="filterProcessesUrl" value="/login/validate" />
<b:property name="usernameParameter" value="username" />
<b:property name="passwordParameter" value="password" />
<b:property name="authenticationSuccessHandler" ref="authSuccessHandler" />
<b:property name="authenticationFailureHandler" ref="authFailureHandler" />
</b:bean>
The component scan is in springapp-servlet.xml
I've created a pastebin of the boot logs. No dice with moving the component scan. http://pastebin.com/ttC5MPnQ