Error on upload image with multiUpload

Hi, I have this Error when I upload image on multiUpload

 <cssLayout stylename="upload-images-wrap" width="100%" >
                                <cssLayout id="previewImageList" stylename="upload-images ">
                                    <cssLayout id="uploadDropzone" stylename="upload-image">
                                        <cssLayout stylename="upload-image-inner dropzone btn-upload" height="AUTO">
                                            <cssLayout stylename="upload-image-dropzone" >
                                                <cssLayout>
                                                    <image width="18px" height="18px">
                                                        <relativePath path="VAADIN/icons/plus.svg"/>
                                                    </image>
                                                </cssLayout>
                                                <cssLayout>
                                                    <multiUpload stylename="uploadDropzoneField camera" id="uploadField" accept=".png,.jpg,.jpeg" />
                                                </cssLayout>
                                                <label stylename="dropzone-label" value="add Image"/>
                                            </cssLayout>
                                        </cssLayout>
                                    </cssLayout>
                                </cssLayout>
                            </cssLayout>
 @Inject
    private FileMultiUploadField uploadFieldRemark;



uploadField.addQueueUploadCompleteListener(queueUploadCompleteEvent -> {
            int index = transactionA.getResultImageList().stream().filter(e ->(e.getRemark()!=null && e.getRemark().equals("Required")) && e.getDeleteFlag().equals(false)).collect(Collectors.toList()).size();
            for (Map.Entry<UUID, String> entry : uploadField.getUploadsMap().entrySet()) {
                index++;

                if (index <= UPLOAD_IMAGE_MAX) {
                    UUID fileId = entry.getKey();
                    String fileName = entry.getValue();
                    FileDescriptor fileDescriptor = fileUploadingAPI.getFileDescriptor(fileId, fileName);
                    if (Boolean.TRUE.equals(checkImageExtension(fileDescriptor.getExtension(), fileDescriptor.getSize()))) {
                        addImage(fileDescriptor, fileId, index, "Required");
                    }
                }
            }

            uploadField.clearUploads();
        });
        uploadField.addFileUploadErrorListener(queueFileUploadErrorEvent ->
            notifications.create().withCaption("File upload error").show()
        );

and this error

16:11:32.410 ERROR com.haulmont.cuba.web.log.AppLog - Exception in com.haulmont.cuba.web.widgets.CubaFileUpload:

2024-01-09T16:11:32.410+07:00	com.vaadin.server.ServerRpcManager$RpcInvocationException: Unable to invoke method queueUploadFinished in com.haulmont.cuba.web.widgets.client.fileupload.CubaFileUploadServerRpc

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:157) ~[vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:115) ~[vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:442) [vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:407) [vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:275) [vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:83) [vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) [vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1636) [vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:465) [vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329) [cuba-web-7.2.19.jar:7.2.19]

2024-01-09T16:11:32.410+07:00	at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215) [cuba-web-7.2.19.jar:7.2.19]

2024-01-09T16:11:32.410+07:00	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) [servlet-api.jar:4.0.FR]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:108) [spring-web-5.2.20.RELEASE.jar:5.2.20.RELEASE]

2024-01-09T16:11:32.410+07:00	at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:74) [spring-web-5.2.20.RELEASE.jar:5.2.20.RELEASE]

2024-01-09T16:11:32.410+07:00	at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:93) [cuba-web-7.2.19.jar:7.2.19]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-websocket.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:126) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at com.haulmont.cuba.web.sys.singleapp.SingleAppWebContextLoader$SetClassLoaderFilter.doFilter(SingleAppWebContextLoader.java:236) [cuba-web-7.2.19.jar:7.2.19]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360) [catalina.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399) [tomcat-coyote.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-coyote.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890) [tomcat-coyote.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789) [tomcat-coyote.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) [tomcat-util.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) [tomcat-util.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.65]

2024-01-09T16:11:32.410+07:00	at java.lang.Thread.run(Thread.java:750) [na:1.8.0_345]

2024-01-09T16:11:32.410+07:00	Caused by: java.lang.reflect.InvocationTargetException: null

2024-01-09T16:11:32.410+07:00	at sun.reflect.GeneratedMethodAccessor587.invoke(Unknown Source) ~[na:na]

2024-01-09T16:11:32.410+07:00	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_345]

2024-01-09T16:11:32.410+07:00	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_345]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:153) ~[vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	... 44 common frames omitted

2024-01-09T16:11:32.410+07:00	Caused by: com.vaadin.event.ListenerMethod$MethodException: Invocation of method queueUploadFinished in com.haulmont.cuba.web.gui.components.WebFileMultiUploadField$$Lambda$2838/1464461724 failed.

2024-01-09T16:11:32.410+07:00	at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:729) ~[vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:399) ~[vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:363) ~[vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1217) ~[vaadin-server-8.14.3-1-cuba.jar:8.14.3-1-cuba]

2024-01-09T16:11:32.410+07:00	at com.haulmont.cuba.web.widgets.CubaFileUpload.fireQueueUploadFinished(CubaFileUpload.java:497) ~[cuba-web-widgets-7.2.19.jar:na]

2024-01-09T16:11:32.410+07:00	at com.haulmont.cuba.web.widgets.CubaFileUpload$1.queueUploadFinished(CubaFileUpload.java:95) ~[cuba-web-widgets-7.2.19.jar:na]

2024-01-09T16:11:32.410+07:00	... 48 common frames omitted

2024-01-09T16:11:32.410+07:00	Caused by: java.lang.NullPointerException: null

Anyone can help ?

Hello!

Could you clarify is it full stacktrace? Based on stacktrace the QueueUploadCompleteEvent should be fired, but during the listeners invocation NPE occurs.

Could you debug your addQueueUploadCompleteListener and check that it does not produce NPE?