Closed serpro69 closed 1 year ago
agentlib does not seem to detect the ByteBuffer
usage, hence tried to fix reflect-config.json
manually by adding:
{
"name": "java.nio.Buffer",
"methods": [
{
"name": "rewind"
}
]
},
{
"name": "java.nio.ByteBuffer",
"methods": [
{
"name": "rewind"
}
]
},
This causes a different error:
> Task :cli-bot:nativeImage
Warning: Ignoring server-mode native-image argument --no-server.
[faker-bot_0.0.0:624051] classlist: 1,631.40 ms, 1.59 GB
[faker-bot_0.0.0:624051] (cap): 512.28 ms, 2.17 GB
[faker-bot_0.0.0:624051] setup: 1,095.86 ms, 2.17 GB
Error: Error parsing reflection configuration in jar:file:/home/sergio/Projects/personal/personal/kotlin-faker/cli-bot/build/libs/cli-bot-0.0.0.jar!/META-INF/native-image/io.github.serpro69/cli-bot/reflect-config.json:
Method java.nio.ByteBuffer.rewind() not found
[faker-bot_0.0.0:624051] [total]: Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option ReflectionConfigurationResources.
2,769.28 ms, 2.17 GB
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
# Printing build artifacts to: /home/sergio/Projects/personal/personal/kotlin-faker/cli-bot/build/graal/faker-bot_0.0.0.build_artifacts.txt
Error: Image build request failed with exit status 1
java.nio.ByteBuffer
in fact does not contain a rewind
method, it's inherited from java.nio.Buffer
, hence this looks to be like an issue with graal. Not sure if a later version will fix it, might be worth a try, but as a temporary fix what seems to work is adding an --allow-incomplete-classpath
option to graal config. This pushes the problem to runtime, but still seems to be working fine (since we're not calling that part of jackson), so should do as a "temporary" workaround (nothing more permanent than temporary, as they say)
seems to be caused by a recent jackson version update - https://github.com/serpro69/kotlin-faker/commit/3d5f71ae540b8a3d7e45905b8df568c8ca435263 build run - https://github.com/serpro69/kotlin-faker/actions/runs/3303548647