0

I have a vaadin project with Spring integration. The project has a single static resource (pdf file) that should be served from the web application, via vaadin's Anchor element.

According to https://vaadin.com/docs/v20/flow/advanced/loading-resources#static-resources the pdf document is placed in src/main/resources/META-INF/resources/documentation.pdf.

When starting the web application directly in my IDE (IntelliJ) the download work as expected. However, running the web application from the maven-generated jar, the download request simply returns "Could not navigate to 'documentation.pdf'". There is no INFO, WARN, ... log entry in the application's log. The documentation.pdf is located in META-INF/resources/documentation.pdf.

vaadin version: 20.0.3 firefox version: 89.0.2

What can I do?

Anna Koskinen
  • 1,362
  • 3
  • 22
  • How do you download it? Directly via URL or do you have a component? – Simon Martinelli Jun 28 '21 at 12:06
  • 1
    And how did you build it with Maven? mvn package -Pproduction? – Simon Martinelli Jun 28 '21 at 12:10
  • 1
    I crated a minimal example and it works. So I assume that you didn't build in production mode – Simon Martinelli Jun 28 '21 at 12:13
  • 2
    Do you have the `download` attribute set? Please share some code. – ollitietavainen Jun 28 '21 at 12:48
  • If there is no log output, is there log output for the packages at all, that make you think, that should give an error? Have you tried ramping up the log-level? Is the PDF inside the JAR? What relative path are you using to reference the file? How do you run the jar (far jar? deployed was war? ...) – cfrick Jun 28 '21 at 14:09
  • To answer the questions: 1. Via Anchor that is placed in a component. 2. The project is build in production mode. 3. What download attribute? 4. The PDF is inside the fat jar located at META-INF/resources/documentation.pdf. The fat jar is used in a docker container, which finally is deployed in an K8s environment. When running the docker container via e.g., docker-compose locally I get the same response "Could not navigate ...". I'm using the relative path documentation.pdf. 5. So far I haven't ramped up the log level. – Jörg Liebig Jun 29 '21 at 13:49
  • The problem is independent from docker/docker-compose and occurs also when I run the fat jar directly. – Jörg Liebig Jun 30 '21 at 07:27

0 Answers0