Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Favicon not showing with Spring 6.2.x Spring Boot 3.4.x #4930

Open
1 task
danielkelemen opened this issue Feb 10, 2025 · 0 comments
Open
1 task

Favicon not showing with Spring 6.2.x Spring Boot 3.4.x #4930

danielkelemen opened this issue Feb 10, 2025 · 0 comments
Labels
scope:spring-boot Changes to the Spring Boot starter. type:bug Issues that describe a user-facing bug in the project.

Comments

@danielkelemen
Copy link
Member

danielkelemen commented Feb 10, 2025

Environment (Required on creation)

Environments with Spring Boot 3.4.* (7.22, 7.23).

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)

Camunda Webapps don't show the favicon with Spring Boot 3.4.x and related Spring versions.
The issue doesn't happen with earlier versions.

Steps to reproduce (Required on creation)

Start Camunda with Spring Boot 3.4.x.
For instance create a new setup with https://start.camunda.com/ and set versions to Camunda 7.22.2 and Spring Boot 3.4.2.

Observed Behavior (Required on creation)

  • Camunda favicon not displayed in browser tab.
  • Url http://localhost:8080/camunda/favicon.ico doesn't work.
  • Additionally there is a WARN displayed:
    2025-02-10T13:23:12.648+01:00  WARN 72446 --- [           main] 
    o.s.w.s.resource.ResourceHandlerUtils    : 
    Appended trailing slash to static resource location: classpath:/META-INF/resources/webjars/camunda/
    

Expected behavior (Required on creation)

Root Cause (Required on prioritization)

We define the favicon's resource location without trailing slash Source which until now was fine.
Recently, as the WARN log also suggests, Spring automatically adds a trailing slash to it.

Due to this trailing slash the resource resolution tries to load META-INF/resources/webjars/camunda/camunda/favicon.ico instead of META-INF/resources/webjars/camunda/favicon.ico. With twice /camunda in path:
Image

If we add a trailing slash then the favicon doesn't work with earlier Spring versions either.

Spring resource resolving:

  1. PathResourceResolver
  2. ClassPathResource
  3. StringUtils.applyRelativePath
    • It cuts of the part from the last trailing slash and adds the relativePath.
    • Before:
      • META-INF/resources/webjars/camunda
      • META-INF/resources/webjars + /camunda/favicon.ico
      • Does it work with custom applicationPath?
    • Now:
      • META-INF/resources/webjars/camunda/
      • META-INF/resources/webjars/camunda + /camunda/favicon.ico

Related issues:

Solution Ideas

  • Add custom ResourceResolver for favicon: fix: add favicon resource resolver #4931
  • Find a nicer built-in way of defining this properly.
  • Double check the behaviour with custom applicationPath. I suspect that might also have issues.

Hints

Links

Breakdown

Pull Requests

Preview Give feedback
No tasks being tracked yet.

Dev2QA handover

  • Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment
@danielkelemen danielkelemen added type:bug Issues that describe a user-facing bug in the project. scope:spring-boot Changes to the Spring Boot starter. labels Feb 10, 2025
danielkelemen added a commit that referenced this issue Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:spring-boot Changes to the Spring Boot starter. type:bug Issues that describe a user-facing bug in the project.
Projects
None yet
Development

No branches or pull requests

1 participant