I am trying to apply security in my spring application using database tables.
What I have so far in my applicationContext-Security is:
All dependencies of Spring Security (such as your DAO) should be decalred in the root web application context (applicationContext.xml
or other XML files configured in <context-param>
named contextConfigLocation
), not in serlvlet's conext (...-servlet.xml
), because core Spring Security beans are declared in the root context, and beans in that context don't have access to beans in the servlet's context.
If you use <context:component-scan>
, you can follow this solution.
See also:
I don't see any declaration for the UserEntityDAOImpl
or Assembler
beans in your context, and no component scanning to auto-detect it.
You either need to declare them alongside the UserDetailsServiceImpl
, or add a <context:component-scan>
somewhere.
i think you forgot to define UserEntityDAO in your app context.