File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes [Spring Security] No bean named 'springSecurityFilterChain' is defined 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 "[Spring Security] No bean named Watch "[Spring Security] No bean named New topic
Author

[Spring Security] No bean named 'springSecurityFilterChain' is defined

Jack Rackham
Greenhorn

Joined: Aug 03, 2011
Posts: 23
Hi everyone !

I'm new on Spring Security, and I'm trying to communicate with a LDAP server. But I have a very weird message, believing Google who only found one result. I have :
No bean named 'springSecurityFilterChain' is defined

I've searched a lot, in the fucking manual too, and I didn't find a solution.

I'm using ubuntu 11.04,
Spring and Spring Security 3.0.2.RELEASE
Spring-LDAP 1.3.1.RELEASE
Maven 2.2.1

Here are the config files :

web.xml :



springConfiguration.xml :



application-context.xml :


Thank you.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I don't see you loading the application-context.xml file anywhere. And that is where you Spring Security beans are defined. So if it doesn't load it, it doesn't create any beans for it.

I actually would have called that file security-config.xml or security-context.xml since all the beans in that xml file are all for Spring Security.

Try this in your web.xml



Now, I am using your file naming there. But I would recommend making it more concise and understandable which config file has what and where to find them.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Jack Rackham
Greenhorn

Joined: Aug 03, 2011
Posts: 23
Thanks. I followed your advice, and I've also made it all again. But I've a new error at login. So I get access to the application, but when I try to log in I've this error :

Your login attempt was not successful, try again.

Reason: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001E4, problem 2001 (NO_OBJECT), data 0, best match of: 'DC=xxx,DC=net' ]; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-031001E4, problem 2001 (NO_OBJECT), data 0, best match of: 'DC=xxx,DC=net' ]; remaining name 'cn=users,dc=xxxx,dc=net'


Here are my new config files :

web.xml



springConfiguration.xml :



and springSecuritySettings.xml :
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

At this point, it doesn't seem to be a Spring issue, but an issue with your LDAP. Meaning either incorrect values for finding LDAP values, or your LDAP isn't available.

Unfortunately, I have no experience with LDAP, so I can't help further.

Good Luck

Mark
Jack Rackham
Greenhorn

Joined: Aug 03, 2011
Posts: 23
OK thanks. haven't ruled the matter yet, but i've tried with a real LDAP (this is for Active Directory). And still got this fucking error code 32.
I give you more details when it's ok ;)
Jack Rackham
Greenhorn

Joined: Aug 03, 2011
Posts: 23
I found a source saying that the matter indeed comes from LDAP. It says that LDAP tries to create an object in an OU that doesn't exist. But in the example he's trying to create an object, whereas I try to get one back !

http://books.google.com/books?id=ASyevTgBK0AC&pg=PT12&lpg=PT12&dq=ldap+%22error+code+32%22&source=bl&ots=Y0wcBeVja-&sig=oGNHrJSCUlnVUctQR_k7TcP9PVQ&hl=en&ei=7N8_TtrVK4Ow8gPa05DmAg&sa=X&oi=book_result&ct=result&resnum=2&ved=0CDQQ6AEwATgK#v=onepage&q=ldap%20%22error%20code%2032%22&f=false

And I had forgotten to give you the LDAP error message :

Your login attempt was not successful, try again.

Reason: [LDAP: error code 32 - No Such Object]; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'ou=people,dc=example,dc=com'
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Spring Security] No bean named 'springSecurityFilterChain' is defined
 
Similar Threads
first app
java.lang.NoClassDefFoundError: java/util/concurrent/ConcurrentSkipListMap
How to define Hibernate SessionFactory with Spring applicationcontext.xml
$ expressions in applicationContext.xml not evaluated
spring security 3.1 login not working.