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

Exception is reported on windows native image building. #11131

Closed
SetoKaiba opened this issue Jul 31, 2020 · 4 comments · Fixed by #11649
Closed

Exception is reported on windows native image building. #11131

SetoKaiba opened this issue Jul 31, 2020 · 4 comments · Fixed by #11649
Labels
env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@SetoKaiba
Copy link
Contributor

Describe the bug
Exception is reported on windows native image building.
It happens from #11048

Expected behavior
It should be able to build native image.

Actual behavior
It does not build native image. Exception is thrown. It's working in previous versions.

Error: Invalid Path entry reflection-config.json
Caused by: java.nio.file.NoSuchFileException: D:\blueeyes\blueeyes-web\build\blueeyes-web-2020.7.31-native-image-source-jar\reflection-config.json

To Reproduce
Steps to reproduce the behavior:

  1. Place a reflection-config.json file in resources folder
  2. Build with application properties specified with reflection-config.json

Configuration

# Configuration file
# key = value

# datasource configuration
quarkus.datasource.url=jdbc:mysql://localhost:3306/blueeyesdb?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
quarkus.datasource.driver=com.mysql.cj.jdbc.Driver
quarkus.datasource.username=root
quarkus.datasource.password=123456

# drop and create the database at startup (use `update` to only update the schema)
quarkus.hibernate-orm.database.generation=update
quarkus.hibernate-orm.database.default-catalog=blueeyesdb

quarkus.infinispan-embedded.xml-config=dist.xml

quarkus.http.port=8081

quarkus.swagger-ui.always-include=true

quarkus.mailer.from[email protected]
quarkus.mailer.host=smtp.qq.com
quarkus.mailer.port=465
quarkus.mailer.ssl=true
quarkus.mailer.username[email protected]
quarkus.mailer.password=123456
quarkus.mailer.mock=false

quarkus.http.cors=true
quarkus.http.cors.access-control-max-age=24H

net.kaiba.blueeyes.rest.RecaptchaService/mp-rest/url=https://recaptcha.net

quarkus.native.additional-build-args =-H:ResourceConfigurationFiles=resources-config.json, -H:ReflectionConfigurationFiles=reflection-config.json, --allow-incomplete-classpath

source.recaptchaV3SiteKey=123456
source.recaptchaBaseUrl=https://recaptcha.net/recaptcha/api.js
source.ignoreCaptchaGlobal=false
source.ignoreActivationGlobal=false
source.host=source.kaiba.net
@SetoKaiba SetoKaiba added the kind/bug Something isn't working label Jul 31, 2020
@quarkusbot quarkusbot added the env/windows Impacts Windows machines label Jul 31, 2020
@SetoKaiba
Copy link
Contributor Author

Anyone? It's working in previous version. But it can't resolve the reflection-config.json in the 1.6.1.Final.

@jaikiran
Copy link
Member

Hello @SetoKaiba, can you share a simple application (preferably as a github repo) which reproduces this issue? Also please include the entire exception stacktrace that you are seeing. By the way, 1.7.0.Final has been released, so please give it a try against that version once.

@SetoKaiba
Copy link
Contributor Author

https://quarkus.io/guides/writing-native-applications-tips#including-resources-2
Here's the doc about reflection-config.json and resources-config.json.

@jaikiran Here's the reproduce project and exception. Just build the native image for it on windows. It's working on linux and mac.
https://github.com/SetoKaiba/my-quarkus-project

19:53:50: Executing task 'build -x test -Dquarkus.package.type=native'...


> Task :quarkusPrepare
preparing quarkus application

> Task :compileJava NO-SOURCE
> Task :processResources
> Task :classes
> Task :jar

> Task :quarkusBuild
building quarkus jar

Uber JAR strategy is used for native image source JAR generation on Windows. This is done for the time being to work around a current GraalVM limitation on Windows concerning the maximum command length (see https://github.com/oracle/graal/issues/2387).
Error: Invalid Path entry reflection-config.json
Caused by: java.nio.file.NoSuchFileException: D:\Quarkus\my-quarkus-project\build\my-quarkus-project-1.0-SNAPSHOT-native-image-source-jar\reflection-config.json

> Task :quarkusBuild FAILED
4 actionable tasks: 4 executed

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusBuild'.
> io.quarkus.builder.BuildException: Build failure: Build failed due to errors
  	[error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
  	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:387)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:932)
  	at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
  	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
  	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
  	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
  	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
  	at java.base/java.lang.Thread.run(Thread.java:834)
  	at org.jboss.threads.JBossThread.run(JBossThread.java:479)
  Caused by: java.lang.RuntimeException: Image generation failed. Exit code: 1
  	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.imageGenerationFailed(NativeImageBuildStep.java:489)
  	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:365)
  	... 12 more


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 16s
19:54:06: Task execution finished 'build -x test -Dquarkus.package.type=native'.

@jaikiran
Copy link
Member

I've opened #11649 with a potential fix.

@gsmet gsmet modified the milestones: 1.8.0 - master, 1.7.2.Final Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants