This week's book giveaways are in the Cloud and AI/ML forums. We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line! See this thread and this one for details.
I have got an application which is primarily Spring based with a little bit of Flex. I wanted trying to pitch in Spring security and was having trouble with getting the versions to match my existing Spring implementation. I was trying to use the Spring security 3.0.5 version. I have picked up the xmls from the sample application that came along with the module.
What is the best way to fix this ?
The applicationContext-security.xml file is the same as in the samples.
AH, yes this fun one. Luckily I had the same problem a couple years ago.
The xml files in the sample applications are pointing to older xsd xml schema files. So you have to go into your xml config file for your Security configuration and at the top, change the xsd version to the correct corresponding version of Spring Security that you are using.
In my sample above, which was originally copied from a sample project did not show "spring-security-2.0.4.xsd" but an older number, and I had to go in and change it to the actual version I was using.
I would like to call it fun ;-) but its a toughie... I think I have the xmls right.
I have to either upgrade all the spring packages which I don't think I can since I might have to revamp a lot of calls in the app so basically I have to either downgrade spring-security-core-3.0.5 or find a way for it to work with org.springframework.core-3.0.0.M3.
Is either of the two options achievable ?
The applicationContext-security.xml that came with the samples. I haven't changed anything
The existing application configuration that I have. I haven't used spring-security-2.0.4 in the app yet.
posted 8 years ago
I managed to download the 2.0.4 examples 2.0.4 samples but even that is giving the following errors in my IDE
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'authentication-provider'. applicationContext-security.xml spring-security-samples-tutorial-2.0.4/WebContent/WEB-INF line 57 XML Problem
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'global-method-security'. applicationContext-security.xml spring-security-samples-tutorial-2.0.4/WebContent/WEB-INF line 19 XML Problem
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'http'. applicationContext-security.xml spring-security-samples-tutorial-2.0.4/WebContent/WEB-INF line 25 XML Problem
Not sure how to answer that. Typically I see errors like that when the xsd isn't configured set up in your IDE, so it doesn't see it and therefore can't validate against those tags.
Are you using STS? If so, in your config file, there is a tab below it that says "namespaces" click that tab and tell us if there is a checkbox for the security namespace. If there is and you click it, what are the versions below the checkbox that is showing up? Try to click one of those versions and let the IDE put the header info into your xml.