配置文件
ldap://localhost:389/
出现异常
org.springframework.webflow.engine.ActionExecutionException: Exception thrown executing [AnnotatedAction@19811ce targetAction = org.jasig.cas.web.flow.AuthenticationViaFormAction@a632be, attributes = map['method' -> 'submit']] in state 'submit' of flow 'login-webflow' -- action execution attributes were 'map['method' -> 'submit']'; nested exception is org.springframework.ldap.UncategorizedLdapException: Operation failed; nested exception is javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
org.springframework.webflow.engine.ActionExecutor.execute(ActionExecutor.java:68)
org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:180)
org.springframework.webflow.engine.State.enter(State.java:200)
org.springframework.webflow.engine.Transition.execute(Transition.java:229)
org.springframework.webflow.engine.TransitionableState.onEvent(TransitionableState.java:112)
org.springframework.webflow.engine.Flow.onEvent(Flow.java:572)
org.springframework.webflow.engine.impl.RequestControlContextImpl.signalEvent(RequestControlContextImpl.java:208)
org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:185)
org.springframework.webflow.engine.State.enter(State.java:200)
org.springframework.webflow.engine.Transition.execute(Transition.java:229)
org.springframework.webflow.engine.TransitionableState.onEvent(TransitionableState.java:112)
org.springframework.webflow.engine.Flow.onEvent(Flow.java:572)
org.springframework.webflow.engine.impl.RequestControlContextImpl.signalEvent(RequestControlContextImpl.java:208)
org.springframework.webflow.engine.impl.FlowExecutionImpl.signalEvent(FlowExecutionImpl.java:214)
org.springframework.webflow.executor.FlowExecutorImpl.resume(FlowExecutorImpl.java:245)
org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:115)
org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:172)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:440)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:115)
root cause
javax.naming.AuthenticationException: [LDAP: error code 49 - Invalid Credentials]
com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2985)
com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2931)
com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2732)
com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2646)
com.sun.jndi.ldap.LdapCtx.(LdapCtx.java:283)
com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
javax.naming.InitialContext.init(InitialContext.java:223)
javax.naming.ldap.InitialLdapContext.(InitialLdapContext.java:134)
org.springframework.ldap.support.LdapContextSource.getDirContextInstance(LdapContextSource.java:59)
org.springframework.ldap.support.AbstractContextSource.createContext(AbstractContextSource.java:193)
org.springframework.ldap.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:104)
org.springframework.ldap.LdapTemplate.search(LdapTemplate.java:263)
org.springframework.ldap.LdapTemplate.search(LdapTemplate.java:314)
org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler.authenticateUsernamePasswordInternal(BindLdapAuthenticationHandler.java:67)
org.jasig.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler.doAuthentication(AbstractUsernamePasswordAuthenticationHandler.java:56)
org.jasig.cas.authentication.handler.support.AbstractPreAndPostProcessingAuthenticationHandler.authenticate(AbstractPreAndPostProcessingAuthenticationHandler.java:58)
org.jasig.cas.authentication.AuthenticationManagerImpl.authenticate(AuthenticationManagerImpl.java:84)
org.jasig.cas.CentralAuthenticationServiceImpl.createTicketGrantingTicket(CentralAuthenticationServiceImpl.java:383)
org.jasig.cas.web.flow.AuthenticationViaFormAction.submit(AuthenticationViaFormAction.java:107)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.springframework.webflow.util.DispatchMethodInvoker.invoke(DispatchMethodInvoker.java:103)
org.springframework.webflow.action.MultiAction.doExecute(MultiAction.java:136)
org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:203)
org.springframework.webflow.engine.AnnotatedAction.execute(AnnotatedAction.java:142)
org.springframework.webflow.engine.ActionExecutor.execute(ActionExecutor.java:61)
org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:180)
org.springframework.webflow.engine.State.enter(State.java:200)
org.springframework.webflow.engine.Transition.execute(Transition.java:229)
org.springframework.webflow.engine.TransitionableState.onEvent(TransitionableState.java:112)
org.springframework.webflow.engine.Flow.onEvent(Flow.java:572)
org.springframework.webflow.engine.impl.RequestControlContextImpl.signalEvent(RequestControlContextImpl.java:208)
org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:185)
org.springframework.webflow.engine.State.enter(State.java:200)
org.springframework.webflow.engine.Transition.execute(Transition.java:229)
org.springframework.webflow.engine.TransitionableState.onEvent(TransitionableState.java:112)
org.springframework.webflow.engine.Flow.onEvent(Flow.java:572)
org.springframework.webflow.engine.impl.RequestControlContextImpl.signalEvent(RequestControlContextImpl.java:208)
org.springframework.webflow.engine.impl.FlowExecutionImpl.signalEvent(FlowExecutionImpl.java:214)
org.springframework.webflow.executor.FlowExecutorImpl.resume(FlowExecutorImpl.java:245)
org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:115)
org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:172)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:857)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:475)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:440)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:115)
结果分析:
有些人在网上copy一个配置文件,就启动cas服务器了,这样是错误的,首先要确定节点名称,还有密码是否和你配置的ldap服务器是否相同,这是导致异常的根源