java.lang.ClassCastException

org.eclipse.jetty.server.Request cannot be cast to com.example.api.rest.security.api.DemoServletRequestWrapper

Solutions on the web19029

  • org.eclipse.jetty.server.Request cannot be cast to com.example.api.rest.security.api.DemoServletRequestWrapper
  • via openwebbeans-user by Thomas Andraschko, 2 weeks ago
    org.eclipse.jetty.server.Request cannot be cast to org.apache.webbeans.context.ConversationContext
  • via Eclipse Bugzilla by vololo100, 1 year ago
    org.springframework.security.web.servletapi.HttpServlet3RequestFactory$Servlet3SecurityContextHolderAwareRequestWrapper cannot be cast to org.eclipse.jetty.server.Request
  • Stack trace

    • java.lang.ClassCastException: org.eclipse.jetty.server.Request cannot be cast to com.example.api.rest.security.api.DemoServletRequestWrapper at com.example.api.filters.XSSFilter.doFilter(XSSFilter.java:30)[classes!/:na] at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1699)[jetty-servlet-9.3.14.v20161028.jar!/:9.3.14.v20161028] 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 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1699)[jetty-servlet-9.3.14.v20161028.jar!/:9.3.14.v20161028] 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 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1699)[jetty-servlet-9.3.14.v20161028.jar!/:9.3.14.v20161028] 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 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1699)[jetty-servlet-9.3.14.v20161028.jar!/:9.3.14.v20161028] 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 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1699)[jetty-servlet-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)[jetty-servlet-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)[jetty-security-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)[jetty-servlet-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.Server.handle(Server.java:534)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)[jetty-server-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)[jetty-io-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)[jetty-io-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)[jetty-io-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)[jetty-util-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)[jetty-util-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)[jetty-util-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)[jetty-util-9.3.14.v20161028.jar!/:9.3.14.v20161028] at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)[jetty-util-9.3.14.v20161028.jar!/:9.3.14.v20161028] at java.lang.Thread.run(Unknown Source)[na:1.8.0_112]

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.