Open mtamboli opened 2 months ago
This can be re-created by running the following FAT bucket:
gradlew com.ibm.ws.jpa.tests.jpa_32_fat:buildAndRun -Dfat.bucket.db.type=SQLServer
Using the default Derby database passes.
I enable -verbose:class
in jvm.options and can see that the Derby driver accesses MBeanServerFactory, initializing the MBeanServer instance; whereas SQLServer and DB2 do not... so then EclipseLink becomes the first code to access MBeanServerFactory and finds the MBeanServer instance has not be created yet.
EclipseLink does handle this scenario, and ends up initializing the MBeanServer instance, but has logged the warning.
For EE 10, I'm guessing that some other feature is initializing the MBeanServer instance earlier, but that has changed for EE 11.
If we can identify the code that is initializing the MBeanServer instance
The component that is creating the MBeanServer can be determined by adding the following in a jvm.options
file:
-Xtrace:print=mt,methods={javax/management/MBeanServerFactory.*},trigger=method{javax/management/MBeanServerFactory.<clinit>,jstacktrace}
For EE 11; this shows that Derby creates the MBeanServer; thus no warning; SQLServer & DB2 do not, so EclipseLink warns
For EE 10; I see the same behavior.... the same warning occurs. Does not appear to be a new problem, just an exiting warning from EclipseLink that does not cause any failures; EclipseLink recovers fine and goes on.
Improved jvm.options
setting:
-Xtrace:print=mt,methods={javax/management/MBeanServerFactory.*},trigger=method{javax/management/MBeanServerFactory.<clinit>,jstacktrace},trigger=method{javax/management/MBeanServerFactory.createMBeanServer,jstacktrace}
Added some extra debug in EclipseLink JMXServerPlatformBase.getMBeanServer()
and found that in the "failing" scenarios, this code receives an empty list when calling MBeanServerFactory.findMBeanServer(null)
, which results in the warning and then goes on to call ManagementFactory.getPlatformMBeanServer()
which works. I think this may just be a normal scenario for Liberty, and the warning can just be ignored... or even removed for Liberty.
My recommendation is:
WebSphere_Liberty_Platform
to add an override of the .getMBeanServer()
metod and just copy the method from the parent class, but change the warning to just a trace statement. The code seems to work fine on Liberty, we just don't want the warning.
Describe the bug
A clear and concise description of what the bug is.
If there is a stack trace, please include the FULL stack trace (without any
[internal classes]
lines in it). To find the full stack trace, you may need to check in$WLP_OUTPUT_DIR/messages.log
I am testing EE11 features and noticed below exception when I use EE11 features as opposed to EE10 after I access database in my test application.
[8/27/24, 12:15:40:794 PDT] 0000002b eclipselink.server W CWWJP9991W: [eclipselink.server] Failed to find MBean Server: null or empty List returned from MBeanServerFactory.findMBeanServer(null).
Steps to Reproduce
Steps to reproduce the bug
Expected behavior
A clear and concise description of what you expected to happen.
This exception is not expected as the Database is configured correctly. This exception does not occur for EE10 features.
Diagnostic information:
java -version
]$WLP_OUTPUT_DIR/messages.log
server.xml
Additional context
Add any other context about the problem here.
There is disucsson on slack channel on this. It was possible to recreate this problem on FVT tests as well.