java.lang.ClassCastException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • java.lang.ClassCastException: io.undertow.servlet.spec.HttpServletRequestImpl cannot be cast to com.example.api.rest.security.api.DemoServletRequestWrapper at com.example.api.filters.XSSFilter.doFilter(XSSFilter.java:30)[classes!/:na] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)[spring-web-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:89)[spring-web-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)[spring-web-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)[spring-web-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.5.RELEASE.jar!/:4.3.5.RELEASE] at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)[undertow-core-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)[undertow-core-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)[undertow-core-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)[undertow-core-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)[undertow-core-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)[undertow-core-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)[undertow-servlet-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.server.Connectors.executeRootHandler(Connectors.java:207)[undertow-core-1.3.25.Final.jar!/:1.3.25.Final] at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:802)[undertow-core-1.3.25.Final.jar!/:1.3.25.Final] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[na:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[na:1.8.0_112] at java.lang.Thread.run(Unknown Source)[na:1.8.0_112]
No Bugmate found.