Pinned topic WAS(8.5) + Spring Security: Using an LDAP Authentication Provider
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.
Nothing 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.
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2013-01-03T15:02:25Z in response to MartinMotovskyHi Martin - did you get an answer/solution to this? I'm hitting exactly the same problem and can't find anything other than complex classloading discussions!
MartinMotovsky 270005E8F02 PostsACCEPTED ANSWER
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2013-01-08T08:08:18Z in response to SystemAdminUnfortunately I did not find the solution. Fortunately (for me only and I know that just temporarily), it was just a test, I did not need it immediately - so I put it away.
gduser 270002Y2BW3 Posts
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2013-03-13T09:04:27Z in response to SystemAdminI am using Websphere Application Server 126.96.36.199 and I am facing exactly the same problem:
22.2.2013 8:41:58:397 EET00000087 webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [S
ervlet Error]-ServletNameNotFound: java.lang.ClassCastException: com.sun.jndi.ldap.LdapCtx incompatible with org.sprin
Does anyone know a workaround for this, or whether it will be fixed in SP 2 ?
Seems that the same LDAP problem with spring security has been also in WAS 8.0 but it has been fixed in 188.8.131.52.
I also found this workaround, but I dont think it's a good option to write all the ldap code again from scratch.
Has anyone managed to get the Spring Security LDAP stuff working in WAS 8.5 ?
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2013-03-13T13:27:47Z in response to SystemAdminHi, It sounds like you have something that works on V184.108.40.206 and not V220.127.116.11 so I think opening a PMR for the service team to look at would be the nest next step.
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2013-03-14T06:07:33Z in response to SystemAdminHi, yeah I think that would be a good thing to do next. I will find out whether someone in my organisation can raise the PMR ticket about this. Thank you!
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2013-04-03T11:45:04Z in response to SystemAdminHi, i am facing the same problem with
Integrated Solutions Console, 18.104.22.168
Build Number: cf011242.02
Build Date: 10/17/12
Is there anybody having a solution?
Hosehead 060000U0C91 PostACCEPTED ANSWER
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2013-04-16T10:05:33Z in response to SystemAdmin
Hello. I found the solution. Installing IBM iFix 22.214.171.124-WS-WASProd-IFPM74498 fixed the problem in WAS 126.96.36.199. Not sure whether the same fix can be installed in 188.8.131.52 though.
HP-ESP 2700059E8Q1 PostACCEPTED ANSWER
Re: WAS(8.5) + Spring Security: Using an LDAP Authentication Provider2013-07-11T16:52:23Z in response to Hosehead
Thank you so much for posting this response. This helped fix my problem.
Just an additional link for someone looking:
This fix went into 184.108.40.206 looks like.