java.lang.ClassCastException: org.glassfish.jersey.server.spring.scope.JaxrsRequestAttributes cannot be cast to org.springframework.web.context.request.ServletRequestAttributes

Spring JIRA | Vikram Hullukunte | 3 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    In jersey-spring3, The org.glassfish.jersey.server.spring.scope.RequestContextFilter class creates JaxrsRequestAttributes datastructure and sets in the Threadlocal. If an exception occurs in the calling chain of the jersey resource and the exception is not handled by jersey, then Spring's RequestContextListner bombs while destroying the threadlocal set as part of the request. The exception: SEVERE: Exception sending request initialized lifecycle event to listener instance of class org.springframework.web.context.request.RequestContextListener java.lang.ClassCastException: org.glassfish.jersey.server.spring.scope.JaxrsRequestAttributes cannot be cast to org.springframework.web.context.request.ServletRequestAttributes at org.springframework.web.context.request.RequestContextListener.requestDestroyed(RequestContextListener.java:70) at org.apache.catalina.core.StandardContext.fireRequestDestroyEvent(StandardContext.java:6080) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:207) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1686) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724)

    Spring JIRA | 3 years ago | Vikram Hullukunte
    java.lang.ClassCastException: org.glassfish.jersey.server.spring.scope.JaxrsRequestAttributes cannot be cast to org.springframework.web.context.request.ServletRequestAttributes
  2. 0

    In jersey-spring3, The org.glassfish.jersey.server.spring.scope.RequestContextFilter class creates JaxrsRequestAttributes datastructure and sets in the Threadlocal. If an exception occurs in the calling chain of the jersey resource and the exception is not handled by jersey, then Spring's RequestContextListner bombs while destroying the threadlocal set as part of the request. The exception: SEVERE: Exception sending request initialized lifecycle event to listener instance of class org.springframework.web.context.request.RequestContextListener java.lang.ClassCastException: org.glassfish.jersey.server.spring.scope.JaxrsRequestAttributes cannot be cast to org.springframework.web.context.request.ServletRequestAttributes at org.springframework.web.context.request.RequestContextListener.requestDestroyed(RequestContextListener.java:70) at org.apache.catalina.core.StandardContext.fireRequestDestroyEvent(StandardContext.java:6080) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:207) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1686) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724)

    Spring JIRA | 3 years ago | Vikram Hullukunte
    java.lang.ClassCastException: org.glassfish.jersey.server.spring.scope.JaxrsRequestAttributes cannot be cast to org.springframework.web.context.request.ServletRequestAttributes
  3. 0

    Help:basic RMI question

    Google Groups | 2 decades ago | Paolo De Lutiis
    java.lang.ClassCastException: serverPackage.ServerClass_Stub at clientPackage.myApplet.init(myApplet.java:line#) at sun.applet.AppletPanel.run(AppletPanel.java:273) at java.lang.Thread.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Shared hosting Bungeecord problems.

    GitHub | 3 years ago | Arksenu
    java.lang.ClassCastException: bka cannot be cast to fs All my servers are set to onlinemode: false Here is my config.yml groups: arksenu: - admin disabled_commands: - find player_limit: -1 stats: 347d1d62-6fb6-4869-bd43-7d0745de8e3c permissions: default: - bungeecord.command.server - bungeecord.command.list admin: - bungeecord.command.ip - bungeecord.command.alert - bungeecord.command.end - bungeecord.command.reload listeners: - max_players: 18 fallback_server: hub host: 0.0.0.0:35289 bind_local_address: true ping_passthrough: false tab_list: GLOBAL_PING default_server: hub forced_hosts: pvp.md-5.net: hub tab_size: 60 force_default_server: true motd: ’Network’ query_enabled: false query_port: 25565 timeout: 30000 connection_throttle: 4000 servers: hub: address: 108.170.8.146:35289 restricted: false motd: test UvGames: address: 66.85.165.170:26200 restricted: false motd: test UvPrison: address: 66.85.128.90:25928 restricted: false motd: test ip_forward: false online_mode: true And here is my console message -> UpstreamBridge has disconnected disconnected with: Exception Connecting:RuntimeException : Server is online mode! @ net.md_5.bungee.ServerConnector:188
  6. 0

    Shared hosting Bungeecord problems.

    GitHub | 3 years ago | Arksenu
    java.lang.ClassCastException: bka cannot be cast to fs All my servers are set to onlinemode: false Here is my config.yml groups: arksenu: - admin disabled_commands: - find player_limit: -1 stats: 347d1d62-6fb6-4869-bd43-7d0745de8e3c permissions: default: - bungeecord.command.server - bungeecord.command.list admin: - bungeecord.command.ip - bungeecord.command.alert - bungeecord.command.end - bungeecord.command.reload listeners: - max_players: 18 fallback_server: hub host: 0.0.0.0:35289 bind_local_address: true ping_passthrough: false tab_list: GLOBAL_PING default_server: hub forced_hosts: pvp.md-5.net: hub tab_size: 60 force_default_server: true motd: ’Network’ query_enabled: false query_port: 25565 timeout: 30000 connection_throttle: 4000 servers: hub: address: 108.170.8.146:35289 restricted: false motd: test UvGames: address: 66.85.165.170:26200 restricted: false motd: test UvPrison: address: 66.85.128.90:25928 restricted: false motd: test ip_forward: false online_mode: true And here is my console message -> UpstreamBridge has disconnected disconnected with: Exception Connecting:RuntimeException : Server is online mode! @ net.md_5.bungee.ServerConnector:188

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      org.glassfish.jersey.server.spring.scope.JaxrsRequestAttributes cannot be cast to org.springframework.web.context.request.ServletRequestAttributes

      at org.springframework.web.context.request.RequestContextListener.requestDestroyed()
    2. Spring
      RequestContextListener.requestDestroyed
      1. org.springframework.web.context.request.RequestContextListener.requestDestroyed(RequestContextListener.java:70)
      1 frame
    3. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.StandardContext.fireRequestDestroyEvent(StandardContext.java:6080)
      2. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:207)
      3. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      4. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:947)
      5. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      6. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      6 frames
    4. Grizzly HTTP
      NioEndpoint$SocketProcessor.run
      1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009)
      2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      3. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1686)
      3 frames
    5. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      3. java.lang.Thread.run(Thread.java:724)
      3 frames