Description
At times Repository login fails because the LoginModule cannot be instantiated
Caused by: javax.jcr.LoginException: unable to find LoginModule class: org.apache.jackrabbit.oak.security.authentication.LoginModuleImpl at org.apache.jackrabbit.oak.jcr.RepositoryImpl.login(RepositoryImpl.java:139) at org.apache.jackrabbit.oak.jcr.SessionImpl.impersonate(SessionImpl.java:114) at org.apache.sling.jcr.base.SessionProxyHandler$SessionProxyInvocationHandler.invoke(SessionProxyHandler.java:101) at $Proxy9.impersonate(Unknown Source) at org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet$1.getLongLivedSession(SlingDavExServlet.java:206)
As a fix LoginContextProviderImpl should switch the Thread's context classloader (TCCL) to oak-jcr bundle's classloader so that required loginmodule class can be instantiated