This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Spring and the fly likes Adding spring-security-core-3.0.5 to org.springframework.core-3.0.0.M3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Adding spring-security-core-3.0.5 to org.springframework.core-3.0.0.M3" Watch "Adding spring-security-core-3.0.5 to org.springframework.core-3.0.0.M3" New topic
Author

Adding spring-security-core-3.0.5 to org.springframework.core-3.0.0.M3

Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183
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.

I have currently the following set of files
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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.

It drove me crazy for three days.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183
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.
Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183
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
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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.

Mark
Jay Abrahm
Ranch Hand

Joined: May 28, 2008
Posts: 183
Thanks, that fixed it.

I had made a lot of changes in the XML preferences (XML Schema File Settings, DTD, ...) a long time ago. I have reverted that and it worked. Just didn't know where to look.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding spring-security-core-3.0.5 to org.springframework.core-3.0.0.M3
 
Similar Threads
Struts2 integration with Spring Security
RequestDispatcher null - cant find /j_spring_security_check
problem with spring security
RichFaces + Spring Security -- Problem Load RichFaces
ScheduledTimerTask - Period is not consistent