Coder Social home page Coder Social logo

Comments (4)

wilkinsona avatar wilkinsona commented on May 2, 2024

This failure indicates that https://github.com/spring-projects/spring-framework/blob/5012843b1254aefa7d81132619c8fa6e3f79b495/spring-core/src/main/java/org/springframework/core/task/VirtualThreadDelegate.java has been loaded instead of https://github.com/spring-projects/spring-framework/blob/5012843b1254aefa7d81132619c8fa6e3f79b495/spring-core/src/main/java21/org/springframework/core/task/VirtualThreadDelegate.java. The latter should be used automatically on Java 21+ due to spring-core being a multi-release jar file. I cannot tell why the correct version is not being loaded automatically without knowing the version of Spring Boot that you are using and exactly how you have built and run your application.

If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

from spring-boot.

smoell avatar smoell commented on May 2, 2024

unicorn-store-spring.tar.gz

Thank you!
I've attached a demo project, you can reproduce the issue with:

  1. Unzip the project
  2. Build the project using docker buildx build --load -t unicorn-store-spring:latest .
  3. cd dockerfiles && docker compose up

from spring-boot.

wilkinsona avatar wilkinsona commented on May 2, 2024

The store-spring.jar that you're building is rather unusual as it contains classes from your application's dependencies in BOOT-INF/classes, including VirtualThreadDelegate:

BOOT-INF/classes/org/springframework/core/task/VirtualThreadTaskExecutor.class

I suspect that this is due to your configuration of the maven-shade-plugin. It's breaking the multi-release nature of spring-core when it shades it, causing the wrong version of VirtualThreadTaskExecutor.class to be loaded.

from spring-boot.

smoell avatar smoell commented on May 2, 2024

Thank you! We need to Maven Shade plugin to generate an artifact for AWS Lambda as well. We'll stick with standard threads until we find a way to fix this. Thank you!.

from spring-boot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.