0

I just set up me web app on top of ElasticBeanstalk. Everything seemed to work fine, until I discovered that my instance couldn't use WebSocket, every time I tried to connect internal server error code was retured.

When I checked the logs, I found NullPointerException which is highly unlikely caused by me. Here's stacktrace:

Aug 27, 2013 5:01:18 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [WebSocketChannel] in context with path [] threw exception
java.lang.NullPointerException
    at org.apache.catalina.websocket.WebSocketServlet.getWebSocketAccept(WebSocketServlet.java:171)
    at org.apache.catalina.websocket.WebSocketServlet.doGet(WebSocketServlet.java:116)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:680)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:679)

My instance is running version 7.0.27. When I checked the source code of tomcat to see the source of problem I couldn't understand a thing.

Any ideas what seems to be causing the problem? Does WebSockets not work with ElasticBeanstalk and Apache Tomcat?

1

1 Answer 1

2

Websockets requires tomcat 7.0.47 or 8, also be sure you have JRE 7 one more thing check that your ELB configured at TCP/SSL level instead of HTTP/HTTPS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.