question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upload events not fired on Vaadin 11.0.2

See original GitHub issue

Downloaded the latest bakery starter (11.0.2), added a simple view with a simple upload component. None of the upload related event listeners are fired. With 11.0.0 and 11.0.1 it worked.

@Route(value = "upload", layout = MainView.class)
@PageTitle(BakeryConst.TITLE_UPLOAD)
public class UploadView extends VerticalLayout {

    public UploadView() {
        MemoryBuffer singleBuffer = new MemoryBuffer();
        Upload upload = new Upload(singleBuffer);
        upload.setAutoUpload(true);
        upload.addSucceededListener(event -> System.out.println("hi")); // prints "hi" only in 11.0.0/.1, not in .2 

        add(upload);
    }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
denis-anisimovcommented, Nov 19, 2018

One more time : Upload works with Flow with any version. Flow doesn’t introduce any new issue/code which influence on this behavior.

Spring add-on has a workaround which allows to have a servlet mapped to “/*” along with Spring endpoints. It does it via forwarding. In previous Spring add-on version there was one solution which caused other issues. But this solution allowed to work Upload in some cases. There was a bug about the same thing with @EnableMVC annotation. Currently the previous solution is removed completely and as a result forwarding works inconsistently with Upload. There is nothing to do in Flow. It’s a pure Spring add-on issue.

0reactions
nuriaruizcommented, Apr 5, 2019

Downloaded the latest bakery starter (11.0.2), added a simple view with a simple upload component. None of the upload related event listeners are fired. With 11.0.0 and 11.0.1 it worked.

@Route(value = "upload", layout = MainView.class)
@PageTitle(BakeryConst.TITLE_UPLOAD)
public class UploadView extends VerticalLayout {

    public UploadView() {
        MemoryBuffer singleBuffer = new MemoryBuffer();
        Upload upload = new Upload(singleBuffer);
        upload.setAutoUpload(true);
        upload.addSucceededListener(event -> System.out.println("hi")); // prints "hi" only in 11.0.0/.1, not in .2 

        add(upload);
    }
}

I solved it by putting this in application.properties: spring.servlet.multipart.enabled = false

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upload Component does not trigger any Upload Events - Vaadin
I've recently updated from Vaadin 11.0.1 to 12.0.0. Now (the already flawed) Upload component ceased to work for me as I won't receive...
Read more >
Vaadin CDI + Event + Push = NoSuchElementException
I.e. when event is fired, session does not know to which UI to deliver it. Your implementation looks strange, I've not seen something...
Read more >
upload component - 2 problems - Vaadin
Problem #1: User can clear uploaded file by clicking 'x' next to uploaded file but the backend does not get information which file...
Read more >
Not able to create production package behind a proxy - Vaadin
I am behind a proxy but my maven settings.xml file contains the necessarily configuration. Everything is working fine - the packages are being...
Read more >
Upload not working - Vaadin
getFileName()+" of size "+event.getContentLength()); }); add(upload); } } ``` I see the upload component under the route, and using the Developer Tools of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found