Closed albertattard closed 1 month ago
Hi @albertattard , thank you for reporting this.
I just reproduced the issue and I confirm the issue you're facing. We'll take a further look into this and I will keep you updated.
Thank you @selhagani. Let me know if you require any further information.
@roberttoyonaga is this something you could look into?
@fniephaus Yup, I can look into this issue.
I was able to reproduce the issue. It looks like the problem is that you need to add serialization configuration for LocalDateTime
.
Adding the below json in serialization-config.json inside the META-INF directory should fix the problem.
{
"types":[
{
"name":"java.time.LocalDateTime"
},
{
"name":"java.time.Ser"
}
],
"lambdaCapturingTypes":[
],
"proxies":[
]
}
Running the Native Image Tracing Agent will help you generate the correct configuration automatically.
It's unfortunate that JMX requires extra configuration, but there isn't a good way of pre-configuring for all use-cases without greatly increasing image size (and remote JMX is already quite heavyweight). Maybe I'll update the JMX docs to suggest users run the tracing agent to generate their custom reflection configuration before using remote JMX.
Thank you very much @roberttoyonaga. I've noticed that some of the attributes that are exposed by the VM have the same issue. How can I address these too, please?
I think
"java.lang.Double"
needs to be added to the serialization config as well. All those "[N/A]" attribute values are doubles.
I'll open a PR to add java.lang.Double
to the remote JMX Feature serialization config. It ought to be added there since its required for the OS platformMXBean.
Until that PR is integrated, you can use this for now:
{
"types":[
{
"name":"java.time.LocalDateTime"
},
{
"name":"java.lang.Double"
},
{
"name":"java.time.Ser"
}
],
"lambdaCapturingTypes":[
],
"proxies":[
]
}
That's great @roberttoyonaga.
I've put a PR up here: https://github.com/oracle/graal/pull/9357
Thanks, Robert! I just took a look :)
This just got fixed on the main branch, and hopefully we can still backport it into the JDK 23 release.
I would like to report an issue I've encountered with GraalVM. While the JDK Mission Control is able to connect to a native image application using JMX, it does not display all fields correctly. Specifically, while
LocalDateTime
fields work well with Java, they fail with the native image, resulting in the following warning:This issue is not limited to application MBeans but also affects the default MBeans available.
To demonstrate this problem, I have created an example which you can find here: graalvm-observability-jmx. Simply build the native image and then run the application. This application will keep running until either the exit operation is executed through JMX or it is manually terminated.
I am using the latest GraalVM 21 version on macOS (M1 chip).
I would appreciate any assistance or guidance you can provide regarding this issue. Thank you very much for your time and support.