tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marko Sanković <>
Subject @ServerEndpoint Guice
Date Wed, 06 Nov 2013 13:55:42 GMT

For the last couple of hours I've been trying to inject a simple object
into the class that is @ServerEndpoint annotated.

As stated: Tomcat implements the Java WebSocket 1.0 API defined by JSR-356.

I'm using Guice as dependency injection framework and Tomcat 7.0.47.

This is how my websocket server endpoint looks like:

public class WsEndpoint {

    InjectedSimpleBean injectedSimpleBean;


I can connect to this endpoint, send and receive messages, but
injectedSimpleBean attribute is null (as expected).

I guess I will have to change the
way java/org/apache/tomcat/websocket/server/
instantiates endpoint class, the getEndpointInstace method will have to
call something like:


but, then again the DefaultServerEndpointConfiguration will also have be
instantiated by the injector.

Any help would be appreciated. Thanks

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message