Sporadic NullPointerException exception in CubaImage

Hi,

A developer (chinese forum) reported that his application will crash in some case, but we can’t found out the cause.

Following is the stack information when app crashed,hopes this information is help to address the problem.If need more information ,tell me please.

  16:47:22.627 ERROR com.haulmont.cuba.web.log.AppLog - Exception:
    java.lang.NullPointerException: null
    at com.haulmont.cuba.web.widgets.CubaImage.attach(CubaImage.java:40) ~[cuba-web-widgets-7.0.7.jar:na]
    at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.server.AbstractClientConnector.attach(AbstractClientConnector.java:643) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.ui.AbstractComponent.attach(AbstractComponent.java:670) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.ui.UI.attach(UI.java:1364) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.ui.UI.setSession(UI.java:499) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:189) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:67) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1577) ~[vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425) [vaadin-server-8.6.4-13-cuba.jar:8.6.4-13-cuba]
    at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329) [cuba-web-7.0.7.jar:7.0.7]
    at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215) [cuba-web-7.0.7.jar:7.0.7]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [servlet-api.jar:na]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [catalina.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.14]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.14]
    at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107) [spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
    at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73) [spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
    at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:108) [cuba-web-7.0.7.jar:7.0.7]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.14]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.14]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [catalina.jar:9.0.14]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.14]
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [catalina.jar:9.0.14]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.14]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.14]
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) [catalina.jar:9.0.14]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [catalina.jar:9.0.14]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.14]
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-coyote.jar:9.0.14]
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:9.0.14]
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) [tomcat-coyote.jar:9.0.14]
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417) [tomcat-coyote.jar:9.0.14]
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.14]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.14]
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]

Environment:
Platform 7.0.7
Running in Studio
OS: Win10 64bit
Browser: chrome:75.0.3770.100

Hello @lugreen

Thank you for reporting the problem, but I cannot suggest a case that leads to this exception.

Will try to reproduce it. Please report any available info.

Regards,
Daniil

Hi Daniil,

Thanks for your reply.

By the description from the developer, the problem occurring have not a certain operating steps.

The steps described by a developer is :
Do some operateing in CUBA application, then switch to other app, some time later, switch back CUBA application, this moment, the CUBA application may be occure the exception and the UI will lost reponse. Then must restart the CUBA application.

By now ,have two developers reported the same problem.