snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

[1.13.3] Static resources disappear in native executable #333

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

Static resources aren't available with a native image. The only extension added is resteasy-reactive. Dev mode works as expected.

Expected behavior

curl to respond with 200 OK

Actual behavior

curl gives 404 Not Found

To Reproduce

Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).

Or attach an archive containing the reproducer to the issue.

Steps to reproduce the behavior:

mvn io.quarkus:quarkus-maven-plugin:1.13.3.Final:create \                             
    -DprojectGroupId=my-groupId \
    -DprojectArtifactId=my-artifactId \
    -DprojectVersion=1.0-SNAPSHOT \
    -Dextensions=resteasy-reactive \
    -DclassName="org.my.group.MyResource"
cd my-artifactId
./mvnw quarkus:dev
...
Listening for transport dt_socket at address: 5005
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2021-05-03 17:26:35,102 INFO  [io.quarkus] (Quarkus Main Thread) my-artifactId 1.0-SNAPSHOT on JVM (powered by Quarkus 1.13.3.Final) started in 1.111s. Listening on: http://localhost:8080
2021-05-03 17:26:35,105 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-05-03 17:26:35,105 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, mutiny, resteasy-reactive, smallrye-context-propagation]
curl -i 'http://localhost:8080'
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 5088
date: Mon, 3 May 2021 15:27:04 GMT
Content-Type: text/html;charset=UTF-8

<!DOCTYPE html>
<html lang="en">
<head>
...
./mvnw clean package -Pnative -DskipTests
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------------< my-groupId:my-artifactId >----------------------
[INFO] Building my-artifactId 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ my-artifactId ---
[INFO] Deleting /home/torben/development/my-artifactId/target
[INFO] 
[INFO] --- quarkus-maven-plugin:1.13.3.Final:generate-code (default) @ my-artifactId ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ my-artifactId ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ my-artifactId ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/torben/development/my-artifactId/target/classes
[INFO] 
[INFO] --- quarkus-maven-plugin:1.13.3.Final:generate-code-tests (default) @ my-artifactId ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ my-artifactId ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/torben/development/my-artifactId/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ my-artifactId ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/torben/development/my-artifactId/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ my-artifactId ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ my-artifactId ---
[INFO] Building jar: /home/torben/development/my-artifactId/target/my-artifactId-1.0-SNAPSHOT.jar
[INFO] 
[INFO] --- quarkus-maven-plugin:1.13.3.Final:build (default) @ my-artifactId ---
[INFO] [org.jboss.threads] JBoss Threads version 3.2.0.Final
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /home/torben/development/my-artifactId/target/my-artifactId-1.0-SNAPSHOT-native-image-source-jar/my-artifactId-1.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /home/torben/development/my-artifactId/target/my-artifactId-1.0-SNAPSHOT-native-image-source-jar/my-artifactId-1.0-SNAPSHOT-runner.jar
[WARNING] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Cannot find the `native-image` in the GRAALVM_HOME, JAVA_HOME and System PATH. Install it using `gu install native-image` Attempting to fall back to container build.
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunner] Using podman to run the native image builder
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunner] Checking image status quay.io/quarkus/ubi-quarkus-native-image:21.0-java11
Trying to pull quay.io/quarkus/ubi-quarkus-native-image:21.0-java11...
Getting image source signatures
Copying blob a1160cb39698 skipped: already exists  
Copying blob 8f403cb21126 skipped: already exists  
Copying blob 65c0f2178ac8 [--------------------------------------] 0.0b / 0.0b
Copying config 148dfc967e done  
Writing manifest to image destination
Storing signatures
148dfc967eb225e956a9379e2b40e8b5c88b5e991a02780ef7867a9a1ec9cf05
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM Version 21.0.0.2 (Java Version 11.0.10+8-jvmci-21.0-b06)
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] podman run --env LANG=C --user 1000:1000 --userns=keep-id --rm -v /home/torben/development/my-artifactId/target/my-artifactId-1.0-SNAPSHOT-native-image-source-jar:/project:z quay.io/quarkus/ubi-quarkus-native-image:21.0-java11 -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -jar my-artifactId-1.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:NativeLinkerOption=-no-pie --no-server -H:-UseServiceLoaderFeature -H:+StackTrace my-artifactId-1.0-SNAPSHOT-runner
[my-artifactId-1.0-SNAPSHOT-runner:20]    classlist:   2,675.55 ms,  0.94 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]        (cap):   1,016.52 ms,  0.94 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]        setup:   2,627.32 ms,  0.94 GB
15:28:23,002 INFO  [org.jbo.threads] JBoss Threads version 3.2.0.Final
[my-artifactId-1.0-SNAPSHOT-runner:20]     (clinit):     632.03 ms,  2.69 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]   (typeflow):  12,838.24 ms,  2.69 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]    (objects):  12,403.16 ms,  2.69 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]   (features):     549.40 ms,  2.69 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]     analysis:  27,815.35 ms,  2.69 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]     universe:   1,427.30 ms,  2.69 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]      (parse):   5,290.81 ms,  3.49 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]     (inline):   2,794.07 ms,  4.14 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]    (compile):  24,366.69 ms,  5.24 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]      compile:  33,991.85 ms,  5.24 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]        image:   2,673.68 ms,  5.24 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]        write:     413.06 ms,  5.24 GB
[my-artifactId-1.0-SNAPSHOT-runner:20]      [total]:  71,854.87 ms,  5.24 GB
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 77439ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:20 min
[INFO] Finished at: 2021-05-03T17:29:19+02:00
[INFO] ------------------------------------------------------------------------
./target/my-artifactId-1.0-SNAPSHOT-runner                                                   
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2021-05-03 17:29:55,093 INFO  [io.quarkus] (main) my-artifactId 1.0-SNAPSHOT native (powered by Quarkus 1.13.3.Final) started in 0.027s. Listening on: http://0.0.0.0:8080
2021-05-03 17:29:55,093 INFO  [io.quarkus] (main) Profile prod activated. 
2021-05-03 17:29:55,093 INFO  [io.quarkus] (main) Installed features: [cdi, mutiny, resteasy-reactive, smallrye-context-propagation]
curl -i 'http://localhost:8080'
HTTP/1.1 404 Not Found
content-length: 0

Configuration

# Add your application.properties here, if applicable.

Screenshots

(If applicable, add screenshots to help explain your problem.)

Environment (please complete the following information):

Output of uname -a or ver

uname -a                               
Linux fedora 5.11.15-300.fc34.x86_64 #1 SMP Fri Apr 16 13:41:48 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

java -version                                  
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment 18.9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9, mixed mode, sharing)

GraalVM version (if different from Java)

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM Version 21.0.0.2 (Java Version 11.0.10+8-jvmci-21.0-b06)

Quarkus version or git rev

grep quarkus pom.xml|grep version                                                        
    <quarkus-plugin.version>1.13.3.Final</quarkus-plugin.version>
    <quarkus.platform.version>1.13.3.Final</quarkus.platform.version>

Build tool (ie. output of mvnw --version or gradlew --version)

./mvnw --version                                                                            
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/torben/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 11.0.11, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-0.fc34.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.11.15-300.fc34.x86_64", arch: "amd64", family: "unix"

Additional context

(Add any other context about the problem here.)

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildContainerRunner] Using podman to run the native image builder

https://github.com/quarkusio/quarkus/issues/16953


$upstream:16953$