Nullpointer on login screen

Hi,

Today I have seen the null pointer below when I left the app on the login screen and came back after a while. I don’t know what triggered it but as no custom code seems to be involved in the stacktrace I guess it must be a platform issue.

My users may experience the same issue so want to avoid this obviously.

CUBA Platform version: 6.4.2
Server: Ubuntu running Docker container with Tomcat8
Browser: Chrome (on windows 10)

Stacktrace:


java.lang.NullPointerException
at org.apache.catalina.connector.Request.notifyAttributeRemoved(Request.java:1563)
at org.apache.catalina.connector.Request.removeAttribute(Request.java:1448)
at org.apache.catalina.connector.RequestFacade.removeAttribute(RequestFacade.java:551)
at javax.servlet.ServletRequestWrapper.removeAttribute(ServletRequestWrapper.java:261)
at org.atmosphere.cpr.AtmosphereRequest.removeAttribute(AtmosphereRequest.java:749)
at org.atmosphere.container.Servlet30CometSupport.endAsyncContext(Servlet30CometSupport.java:132)
at org.atmosphere.container.Servlet30CometSupport.complete(Servlet30CometSupport.java:117)
at org.atmosphere.container.Servlet30CometSupport.complete(Servlet30CometSupport.java:44)
at org.atmosphere.cpr.AtmosphereResourceImpl.cancel(AtmosphereResourceImpl.java:762)
at org.atmosphere.cpr.AtmosphereResourceImpl.dirtyClose(AtmosphereResourceImpl.java:868)
at org.atmosphere.cpr.DefaultBroadcaster.addAtmosphereResource(DefaultBroadcaster.java:1429)
at org.atmosphere.cpr.AtmosphereResourceImpl.suspend(AtmosphereResourceImpl.java:407)
at com.vaadin.server.communication.PushHandler.suspend(PushHandler.java:180)
at com.vaadin.server.communication.PushHandler$1.run(PushHandler.java:105)
at com.vaadin.server.communication.PushHandler.callWithUi(PushHandler.java:240)
at com.vaadin.server.communication.PushHandler.onConnect(PushHandler.java:483)
at com.vaadin.server.communication.PushAtmosphereHandler.onConnect(PushAtmosphereHandler.java:99)
at com.vaadin.server.communication.PushAtmosphereHandler.onRequest(PushAtmosphereHandler.java:75)
at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:199)
at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:107)
at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:66)
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:2075)
at com.vaadin.server.communication.PushRequestHandler.handleRequest(PushRequestHandler.java:248)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1422)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:384)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:276)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:185)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.haulmont.cuba.web.sys.CubaHttpFilter.handleNotFiltered(CubaHttpFilter.java:108)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:95)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2445)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

Any help appreciated.

Hi!

It seems that it is the problem with Atmosphere web socket connection. As a workaround you can switch to Long-Polling mode instead of Web Sockets using special application property cuba.web.pushLongPolling: https://doc.cuba-platform.com/manual-6.5/app_properties_reference.html#cuba.web.pushLongPolling

Could you share your installation details? Do you use Nginx or another HTTP proxy?

Hi Yuriy,

Thanks for explaining. Is this still a platform issue or is this something that can only be avoided using the mentioned workaround?

I use nginx as a proxy server on my host and redirect all traffic to the CUBA applications running on Tomcat (in docker containers).

I looked at the documentation that you mention and assume that the required nginx configuration refers to these properties:

   proxy_read_timeout     3600;
    proxy_connect_timeout  240;

Correct?

Will try and see if it works / improves. I’m not sure that I can reproduce the issue sufficiently to really know for sure.

Regards, Berend Tel

Since you use Nginx, do not forget to change its settings according to this manual page: https://doc.cuba-platform.com/manual-6.5/server_push_settings.html In this case it should work without using the workaround.

The main part of the settings is:


    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

It is required for Web Socket protocol.

After applying the settings I have not seen the error return. Consider it solved.