Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by niliubang
, 1 year ago
org.apereo.cas.authentication.UsernamePasswordCredential cannot be cast to org.apereo.cas.authentication.Credential
java.lang.ClassCastException: org.apereo.cas.authentication.UsernamePasswordCredential cannot be cast to org.apereo.cas.authentication.Credential	at org.apereo.cas.web.support.WebUtils.getCredential(WebUtils.java:341)	at org.apereo.cas.web.flow.resolver.impl.AbstractCasWebflowEventResolver.getCredentialFromContext(AbstractCasWebflowEventResolver.java:167)	at org.apereo.cas.web.flow.resolver.impl.InitialAuthenticationAttemptWebflowEventResolver.resolveInternal(InitialAuthenticationAttemptWebflowEventResolver.java:42)	at org.apereo.cas.web.flow.resolver.impl.AbstractCasWebflowEventResolver.resolve(AbstractCasWebflowEventResolver.java:427)	at org.apereo.cas.web.flow.resolver.impl.AbstractCasWebflowEventResolver.resolveSingle(AbstractCasWebflowEventResolver.java:440)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	at java.lang.reflect.Method.invoke(Method.java:498)	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)	at com.sun.proxy.$Proxy128.resolveSingle(Unknown Source)	at org.apereo.cas.web.flow.AuthenticationViaFormAction.doExecute(AuthenticationViaFormAction.java:54)	at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)	at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)	at org.springframework.webflow.action.EvaluateAction.doExecute(EvaluateAction.java:77)	at org.springframework.webflow.action.AbstractAction.execute(AbstractAction.java:188)	at org.springframework.webflow.execution.AnnotatedAction.execute(AnnotatedAction.java:145)	at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:51)	at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:101)	at org.springframework.webflow.engine.State.enter(State.java:194)	at org.springframework.webflow.engine.Transition.execute(Transition.java:228)	at org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:395)	at org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214)	at org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:116)	at org.springframework.webflow.engine.Flow.handleEvent(Flow.java:547)	at org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:390)	at org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210)	at org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:231)	at org.springframework.webflow.engine.ViewState.resume(ViewState.java:195)	at org.springframework.webflow.engine.Flow.resume(Flow.java:537)	at org.springframework.webflow.engine.impl.FlowExecutionImpl.resume(FlowExecutionImpl.java:259)	at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:169)	at org.springframework.webflow.executor.FlowExecutorImpl$$FastClassBySpringCGLIB$$661d80a9.invoke()	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655)	at org.springframework.webflow.executor.FlowExecutorImpl$$EnhancerBySpringCGLIB$$6957db5a.resumeExecution()	at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:253)	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apereo.cas.web.support.CurrentCredentialsAndAuthenticationClearingFilter.doFilter(CurrentCredentialsAndAuthenticationClearingFilter.java:28)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apereo.cas.security.RequestParameterPolicyEnforcementFilter.doFilter(RequestParameterPolicyEnforcementFilter.java:261)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apereo.cas.security.ResponseHeadersEnforcementFilter.doFilter(ResponseHeadersEnforcementFilter.java:238)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apereo.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:62)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:105)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apereo.cas.logging.web.ThreadContextMDCServletFilter.doFilter(ThreadContextMDCServletFilter.java:90)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:87)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:107)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)	at org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:260)	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:677)	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)	at java.lang.Thread.run(Thread.java:745)