When trying to instrument a locally via the Atlassian SDK started Confluence with the Java VisualVM for profiling, the following exception is thrown:
Caused by: java.lang.NoClassDefFoundError: org/netbeans/lib/profiler/server/ProfilerRuntimeCPUFullInstr
What seems to tell that a required class is not provided is actually a complaint that the OSGi subsystem has not been configured properly.
Add the following lines to specify a profile with additional system properties to your Maven POM to configure Confluence:
<profile> <id>profiling</id> <build> <pluginManagement> <plugins> <plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-confluence-plugin</artifactId> <version>6.3.21</version> <extensions>true</extensions> <configuration> <systemPropertyVariables> <atlassian.org.osgi.framework.bootdelegation>org.netbeans.lib.profiler.*,sun.*,com.sun.*</atlassian.org.osgi.framework.bootdelegation> <atlassian.org.osgi.framework.system.packages>org.netbeans.lib.profiler.server</atlassian.org.osgi.framework.system.packages> </systemPropertyVariables> </configuration> </plugin> </plugins> </pluginManagement> </build> </profile>
Start the Confluence server locally using the Atlassian SDK:
atlas-debug -Pprofiling
Then add a configuration to limit instrumentation to classes you want to take execution performance measurements and start the instrumentation.