Hello,
I'm running a web app on Wildfly 23 (using Java 11).
I need to use the JFR API to be able to start and stop JFR recordings directly from my application.
The problem is that I get ClassNotFoundExceptions when starting my app as JFR API classes cannot be found.
Searching around I've found multiple solutions but I don't know which one is the right one.
I've seen people saying to add this in the <dependencies> of jboss-deployment-structure.xml :
<system export="true">
<paths>
<path name="com/sun/management"/>
<path name="jdk/jfr"/>
<path name="jdk/management/jfr"/>
</paths>
</system>
Others saying to add this :
<module name="jdk.jfr"/>
Which way is the recommended one ?
What is the difference between Wildfly "jdk.jfr" module and system modules "jdk/jfr", "jdk/management/jfr", ... provided by the Java runtime ?
Why does Wildfy has a "jdk.jfr" module if the "jdk.jfr" module is already provided by Java runtime ?
Which one should I use ?