wood burning stoves 2.0*
The moose likes Spring and the fly likes nullpointer with @Autowired AuthenticationManager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "nullpointer with @Autowired AuthenticationManager" Watch "nullpointer with @Autowired AuthenticationManager" New topic
Author

nullpointer with @Autowired AuthenticationManager

Christopher Whu
Ranch Hand

Joined: Sep 03, 2008
Posts: 80
This is making me crazy - am trying to integrate a custom Auth bean and i am getting this a null pointer error when i reference my autowired auth manager.

the null pointer is thrown at:
Authentication result = authenticationManager.authenticate(request);


my bean



my app context:
[COLOR=#000080][/COLOR]


The bean must see AM in my context because if i change the alias of the AuthenticationManager in my context the app wont compile. please advise....
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

I don't see the problem either. I know this sounds strange but did you c+p any of the stuff in the code below? If you did delete those pieces and re-type it out. I have had weird stuff like this happen to me when I have copied stuff into eclipse from a different place. It looks exactly the same but re-typing it makes it work


[How To Ask Questions][Read before you PM me]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: nullpointer with @Autowired AuthenticationManager
 
Similar Threads
RequestDispatcher null - cant find /j_spring_security_check
Session getting created twice and session not getting decremented.
spring security form based login using database not responding
Spring security 3.0
No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional