Thanks for the reply. I am actually testing the code of chapter 5 of your book on Spring Security 3.
I do remember @PreAuthorize("hasRole('ROLE_ADMIN')") working from Interface IUserService.java when i tested it first but now when I am testing it again, it doesnt seem to be working the way it is supposed to, i.e. @PreAuthorize is not being detected either.
If I use the security namespace from dogstore-security.xml, I am being shown an error saying:
, which on further look up says
Referenced file contains errors (http://www.springframework.org/schema/security/spring-security-3.0.xsd). For more information, right click on the message in the Problems View and select "Show Details..."
where number of lines in my dogstore-security.xml file is 80 only.
XML document structure must start and end within the same entity on line number 517
But if use the namespace as below:
.. it gives me an error
The code that I am using is the code that came with the book Spring Security 3 only, so..
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: You cannot use a spring-security-2.0.xsd schema with Spring Security 3.0. Please update your schema declarations to the 3.0 schema.
1> Do you have any other annotations that _are_ working?
-- I did see @PreAuthorize("hasRole('ROLE_ADMIN')") from Interface IUserService.java working earlier from chapter 5 but even this one doesnt seem to work anymore.
2> Are you making a call to this interface from another method in the same class?
-- No, I am calling it from the method getCategories() in HomeController.java
3> Are you instantiating this bean using Spring DI?
--Yes, the bean is being instantiated using DI only.
4> Have you enabled DEBUG logging for org.springframework.security?
-- It has been configured in the log4j.xml file you provided with the code.
Could this be cause of the error that I am getting in the security config file? The application runs but it is not detecting the annotations for security.
I wonder what was making @PreAuthorize work earlier?
I wonder what am I missing here?