google / guice

Guice (pronounced 'juice') is a lightweight dependency injection framework for Java 11 and above, brought to you by Google.
https://github.com/google/guice
Apache License 2.0
12.51k stars 1.67k forks source link

Doen't work with caucho resin Websocket #792

Open gissuebot opened 10 years ago

gissuebot commented 10 years ago

From mattermark3 on December 12, 2013 08:26:48

Description of the issue: Steps to reproduce: 1. Set up caucho resin

  1. In servlet service add line:

final WebSocketServletRequest wsReq = (WebSocketServletRequest) req;                 

  1. You get exception

WARNING: java.lang.ClassCastException: com.google.inject.servlet.ServletDefinition$2 cannot be cast to com.caucho.websocket.WebSocketServletRequest java.lang.ClassCastException: com.google.inject.servlet.ServletDefinition$2 cannot be cast to com.caucho.websocket.WebSocketServletRequest

Original issue: http://code.google.com/p/google-guice/issues/detail?id=792

gissuebot commented 10 years ago

From mattermark3 on December 16, 2013 05:50:15

Just need to cast to HttpServletRequestWrapper...

gissuebot commented 10 years ago

From romikk on December 16, 2013 05:50:57

Try doing this instead:

ServletRequestWrapper servletRequest = (ServletRequestWrapper) req

WebSocketServletRequest wsReq = (WebSocketServletRequest) servletRequest.getRequest();