This is a reproducer project for the quarkusio/quarkus#26780
The class FileResource won't be properly exposed in native mode unless annotated with @RegisterForReflection
.
Package and run the application:
mvn clean package
java -jar target/quarkus-app/quarkus-run.jar
- Open your browser and go to http://localhost:8080/
- You should be able to click on the links and load the included files.
Alternatively run:
curl localhost:8080/file-001.txt
Which should load the requested file.
Package and run the application:
mvn clean package -Pnative
./target/reactive-nosuchmethodexception-1.0.0-SNAPSHOT-runner
Run:
curl localhost:8080/file-001.txt
The application log should print an error:
Caused by: java.lang.NoSuchMethodException: FileResource.getStaticFile(java.lang.String)