I have tested this simple tutorial "Spring Security - MVC: Using an LDAP Authentication Provider":
I am able to run it successfully at Tomcat, Glassfish, even at WAS8.5 Liberty Profile. But when I run it at the full WAS profile, I experience the following exception:
java.lang.ClassCastException: com.sun.jndi.ldap.LdapCtx incompatible with org.springframework.ldap.core.DirContextAdapter
After the surfing at Internet, I tried the following:
In the Administrative Console,
Server-specific Application Settings -> Classloader policy I set up: Single.
Server-specific Application Settings -> Class loading mode: I tried both options - "Classes loaded with parent class loader first" as well as "Classes loaded with local class loader first (parent last)"
I have restarted server after each change.
I found a recommendation to set up a custom property
com.ibm.ws.webcontainer.invokefilterscompatibility = true
in the Administrative Console -> Application servers -> my server -> Web container -> Customer properties.
Noting from the above helped.
I have noticed, that when I see into the Class loader viewer, the class com.sun.jndi.ldap.LdapCtxFactory is loaded by two classloaders:
1) Extension - com.ibm.ws.bootstrap.ExtClassLoader
and also by
2) Module - com.ibm.ws.classloader.CompoundClassLoader
I guess, that the above information could help to solve the problem.
Thanks for the hint how to step forward.
This topic has been locked.
Pinned topic WAS(8.5) + Spring Security: Using an LDAP Authentication Provider
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Jacek_Laskowski 060001359D133 Posts
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2012-10-19T08:57:47ZThis is the accepted answer. This is the accepted answer.Hi,
It'd be more rewarding if the issue were reported to the full WebSphere Application Server forum. "This forum is for the WASdev community members to interact with each other and with the WAS development staff on questions and issues related to the WASdev community (wasdev.net)."
Japila :: verba docent, exempla trahunt
MartinMotovsky 270005E8F05 Posts
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2012-10-22T13:39:38ZThis is the accepted answer. This is the accepted answer.
- Jacek_Laskowski 060001359D