-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Cannot construct instance of java.nio.file.Path
with GraalVM Native Image
#3725
Comments
Manually add Java7HandlersImpl in reflect-config fix the issue: korandoru/hawkeye#37 But still I expect an automatic tool like picocli-codegen to analyze and generate such a config file for me. |
I think this is due to dynamic loading of support for Potentially #3708 merged in 2.15 might help here, possibly solving the problem. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@cowtowncoder It helps. I try with a commit: diff --git a/hawkeye-core/pom.xml b/hawkeye-core/pom.xml
index 79c1c3d..f2337a9 100644
--- a/hawkeye-core/pom.xml
+++ b/hawkeye-core/pom.xml
@@ -32,6 +32,16 @@
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-toml</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
diff --git a/hawkeye-core/src/main/resources/META-INF/native-image/hawkeye-core/reflect-config.json b/hawkeye-core/src/main/resources/META-INF/native-imag
e/hawkeye-core/reflect-config.json
index 0347aee..3139dc3 100644
--- a/hawkeye-core/src/main/resources/META-INF/native-image/hawkeye-core/reflect-config.json
+++ b/hawkeye-core/src/main/resources/META-INF/native-image/hawkeye-core/reflect-config.json
@@ -6,13 +6,5 @@
"allDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredFields": true
- },
- {
- "name": "com.fasterxml.jackson.databind.ext.Java7HandlersImpl",
- "allDeclaredConstructors": true,
- "allPublicConstructors": true,
- "allDeclaredMethods": true,
- "allPublicMethods": true,
- "allDeclaredFields": true
}
]
diff --git a/pom.xml b/pom.xml
index bcd8758..b014cf2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,6 +31,15 @@
<url>https://github.com/korandoru/hawkeye</url>
+ <repositories>
+ <repository>
+ <id>snapshots-repo</id>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+ <releases><enabled>false</enabled></releases>
+ <snapshots><enabled>true</enabled></snapshots>
+ </repository>
+ </repositories>
+
<licenses>
<license>
<name>Apache 2.0 License</name>
@@ -107,6 +116,11 @@
<artifactId>jackson-dataformat-toml</artifactId>
<version>${jackson-dataformat-toml.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.15.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> |
How can I get notified when 2.15.0 released? |
One way is to follow https://groups.google.com/g/jackson-announce and of course there is Release page itself: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.15 where announcement is sent. It will take a while for 2.15 to get released; I hope we can get release candidates out in maybe March 2023. |
FYI - verified and upgraded korandoru/hawkeye#83 |
Reproduce
https://github.com/tisonkun/hawkeye/tree/repro-jackson-native
# Use GraalVM 22.3.0 ./mvnw clean package -DskipTests -Pnative ./distribution/native/target/hawkeye-native check
... throws:
picocli provides picocli-codegen to generate Native Image configs file. I wonder whether jackson ecosystem has a similar solution or how I can properly config it.
It seems that
NioPathDeserializer
isn't contained in the final image due to inaccurate dead code analysis.Ref: korandoru/hawkeye#18
The text was updated successfully, but these errors were encountered: