NotCompliantMBeanException during cache creation

ioi.lam at oracle.com ioi.lam at oracle.com
Tue Mar 18 03:47:39 UTC 2025


On 3/16/25 1:09 AM, Alan Bateman wrote:
> On 16/03/2025 02:12, ioi.lam at oracle.com wrote:
>> Could you send the exact command-line that causes the error? If you 
>> can share a self-contain reproducible test case, that would be great!
>>
>> Looking from the stack trace:
>>
>>     at 
>> jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startLocalConnectorServer(ConnectorBootstrap.java:542)
>>     at 
>> jdk.management.agent/jdk.internal.agent.Agent.startLocalManagementAgent(Agent.java:316)
>>     at 
>> jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:448)
>>     at 
>> jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:601)
>>
>> It looks like you might have specified a Java agent in the "java 
>> -XX:AOTMode=create ...." command line. Can you try removing that and 
>> see if it works?
>
> I assume it's something started with -Dcom.sun.management=... to start 
> the JMX agent. This sets in motion the registration of management 
> beans and the JMX introspector machinery that looks at annotations and 
> causes Proxy classes to be generated into dynamic modules.
>
> Ioi - I suspect the restriction on creating dynamic modules in the 
> dump phase may be too restrictive. The full module graph dumping 
> should only be concerned with the boot layer.
>
> -Alan


Hi Alan, thanks for the information. I've created 
https://bugs.openjdk.org/browse/JDK-8352187 to address this problem.

I verified that the dynamic modules created by the dynamic proxies 
always have a null for its ModuleLayer. Also, there are no APIs for 
adding new modules into the boot layer (after the boot layer has been 
initialized), so the usage of ProxyBuilder.getDynamicModule() shouldn't 
cause problems for CDS.

https://github.com/openjdk/jdk/blob/38499b3fbfcd22252ddf860d42b9eb0bf6f77235/src/java.base/share/classes/jdk/internal/module/Modules.java#L76-L82
https://github.com/openjdk/jdk/blob/38499b3fbfcd22252ddf860d42b9eb0bf6f77235/src/java.base/share/classes/java/lang/System.java#L2033-L2037

Thanks

- Ioi




More information about the leyden-dev mailing list