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

Native mode not working in 1.4.1.Final #8891

Closed
rmpestano opened this issue Apr 27, 2020 · 3 comments · Fixed by #8907
Closed

Native mode not working in 1.4.1.Final #8891

rmpestano opened this issue Apr 27, 2020 · 3 comments · Fixed by #8907
Labels
kind/bug Something isn't working
Milestone

Comments

@rmpestano
Copy link

Describe the bug
As discussed in zulip chat I'm not able to run my application in native mode after migrating to quarkus 1.4.1.Final.

The native binary is generated but when I run the application, nothing happens.

Expected behavior
The application should start and accept requests at localhost:8080

Actual behavior
Nothing happens when we run the native binary.

The application works normally in JVM mode.

To Reproduce
Steps to reproduce the behavior, just run the following commands:

git clone https://github.com/apache/myfaces quarkus-myfaces && cd quarkus-myfaces && git checkout e21f7ac5fbbf5a1f99b166bd9d4a23d9e4221712 && mvn install -DskipTests && cd extensions/quarkus && mvn install && cd showcase && mvn package -Pnative && ./target/quarkus-myfaces-showcase-1.0-SNAPSHOT-runner

Console output

Following are console logs:

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on GraalVM Version 19.3.1 CE
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] /home/rmpestano/opt/graalvm-ce-java8-19.3.1/bin/native-image -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-Dfile.encoding=UTF-8 --report-unsupported-elements-at-runtime --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -H:+JNI -jar quarkus-myfaces-showcase-1.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:-IncludeAllTimeZones -H:EnableURLProtocols=http -H:NativeLinkerOption=-no-pie --no-server -H:-UseServiceLoaderFeature -H:+StackTrace quarkus-myfaces-showcase-1.0-SNAPSHOT-runner
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] classlist: 17,264.41 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] (cap): 910.18 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] setup: 2,554.97 ms
java.lang.RuntimeException: Failed to load resource META-INF/resources/licenses/the bsd 3-clause license - bsd-3-clause.txt.html
at io.quarkus.runtime.ResourceHelper.registerResources(ResourceHelper.java:25)
at io.quarkus.runner.AutoFeature.beforeAnalysis(AutoFeature.zig:27084)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$7(NativeImageGenerator.java:669)
at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:63)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:669)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:530)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.nio.file.NoSuchFileException: META-INF/resources/licenses/the%20bsd%203-clause%20license%20-%20bsd-3-clause.txt.html
at com.sun.nio.zipfs.ZipFileSystem.newInputStream(ZipFileSystem.java:544)
at com.sun.nio.zipfs.ZipPath.newInputStream(ZipPath.java:645)
at com.sun.nio.zipfs.ZipFileSystemProvider.newInputStream(ZipFileSystemProvider.java:278)
at java.nio.file.Files.newInputStream(Files.java:152)
at io.quarkus.runtime.util.ClassPathUtils.readStream(ClassPathUtils.java:181)
at io.quarkus.runtime.util.ClassPathUtils.consumeStream(ClassPathUtils.java:158)
at io.quarkus.runtime.util.ClassPathUtils.consumeAsStreams(ClassPathUtils.java:52)
at io.quarkus.runtime.ResourceHelper.registerResources(ResourceHelper.java:17)
... 11 more
05:38:42,015 INFO [org.apa.myf.web.MyFacesContainerInitializer] Using org.apache.myfaces.webapp.MyFacesContainerInitializer
05:38:42,420 INFO [org.apa.myf.uti.ExternalSpecifications] MyFaces Core Bean Validation support disabled
05:38:42,440 INFO [org.apa.myf.uti.ExternalSpecifications] MyFaces Core CDI support enabled
05:38:42,440 INFO [org.apa.myf.uti.ExternalSpecifications] MyFaces Core EL 3.0 support enabled
05:38:42,441 INFO [org.apa.myf.uti.ExternalSpecifications] MyFaces Core Servlet 4.0 support enabled
05:38:42,478 INFO [org.pri.web.PostConstructApplicationEventListener] Running on PrimeFaces 8.0
05:38:42,479 INFO [org.apa.myf.web.AbstractFacesInitializer] f:websocket support enabled but cannot found websocket ServerContainer instance on current context.
05:38:42,479 WARNING [org.apa.myf.web.AbstractFacesInitializer]

* WARNING: Apache MyFaces Core is running in DEVELOPMENT mode. *
* ^^^^^^^^^^^ *
* Do NOT deploy to your live server(s) without changing this. *
* See Application#getProjectStage() for more information. *
****************

05:38:42,480 INFO [org.apa.myf.web.StartupServletContextListener] MyFaces Core has started, it took [463] ms.
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] (typeflow): 45,429.88 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] (objects): 13,762.43 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] (features): 402.83 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] analysis: 60,476.40 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] (clinit): 495.27 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] universe: 1,256.91 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] (parse): 31,382.04 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] (inline): 3,373.92 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] (compile): 21,146.61 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] compile: 57,161.93 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] image: 1,765.04 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] write: 384.22 ms
[quarkus-myfaces-showcase-1.0-SNAPSHOT-runner:3555] [total]: 141,526.68 ms
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 144230ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:41 min
[INFO] Finished at: 2020-04-27T05:40:42-03:00
[INFO] ------------------------------------------------------------------------
(base) rmpestano@oss-powerhouse:~/projects/myfaces-method/extensions/quarkus/showcase$ ./target/quarkus-myfaces-showcase-1.0-SNAPSHOT-runner
(base) rmpestano@oss-powerhouse:~/projects/myfaces-method/extensions/quarkus/showcase$

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

Environment (please complete the following information):

Maven home: /usr/share/maven
Java version: 1.8.0_252, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-96-generic", arch: "amd64", family: "unix"
graalvm-ce-java8-19.3.1

Same happens with Java 11 and graalvm-ce-java11-19.3.1

Additional context

I noted that the generated binary is much smaller than the one generated by v1.3.2, around 25MB against 100MB in the previous version.

@rmpestano rmpestano added the kind/bug Something isn't working label Apr 27, 2020
@geoand
Copy link
Contributor

geoand commented Apr 28, 2020

@rmpestano Once again I was not able to reproduce your error :)

Oh, my mistake - it does seem like the the native-image completes, but the binary indeed doesn't run.

@rmpestano
Copy link
Author

Also if you rollback to quarkus 1.3.2 you'll see that the native binary will work

@geoand
Copy link
Contributor

geoand commented Apr 28, 2020

Will take a look, thanks

geoand added a commit to geoand/quarkus that referenced this issue Apr 28, 2020
geoand added a commit that referenced this issue Apr 28, 2020
Fix issue with reading resources containing spaces
@gsmet gsmet added this to the 1.4.2.Final milestone Apr 30, 2020
gsmet pushed a commit to gsmet/quarkus that referenced this issue May 1, 2020
gwenneg pushed a commit to gwenneg/quarkus that referenced this issue May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants