I have written a Java Agent along with an SWT GUI for controlling the agent.
https://github.com/mchr3k/org.intrace/wiki
I want to package this library into a plugin for VisualVM to allow the agent to be attached to a JVM using VisualVM.
I have written a Netbeans module to do this right here:
http://github.com/mchr3k/org.intrace/tree/master/InTrace-VisualVM-Plugin/
This works when I run the project from Netbeans. However, when I use “Create NBM” to package the project the resulting library fails to install in VisualVM. The output from the log is as follows:
INFO [org.netbeans.modules.autoupdate.services.InstallSupportImpl]: Timeout waiting for loading module org.intrace.visualvm/1.0 INFO [org.netbeans.modules.autoupdate.ui.wizards.InstallStep]: timeout of loading InTrace Launcher[org.intrace.visualvm/1.0] org.netbeans.api.autoupdate.OperationException: timeout of loading InTrace Launcher[org.intrace.visualvm/1.0] at org.netbeans.modules.autoupdate.services.InstallSupportImpl$3.call(InstallSupportImpl.java:437) at org.netbeans.modules.autoupdate.services.InstallSupportImpl$3.call(InstallSupportImpl.java:302) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [catch] at java.lang.Thread.run(Thread.java:619)
I’m also suspicious that my agent and client libraries have not been packaged into the nbm file as it is way too small.
I suspect that the problem is that I need to add something to the project build.xml but I am struggling to work out what.
http://github.com/mchr3k/org.intrace/blob/master/InTrace-VisualVM-Plugin/build.xml
Can anyone suggest what I am missing?
Let me guess – you are using NetBeans 6.9 to develop and package the module and then you try to load it in VisualVM 1.2.* or jvisualvm? If that’s the case you’ve just encountered a compatibility issue when modules targeted to NetBeans 6.9 platform are not easily installable in eg. NetBeans 6.8 based application (such as VisualVM 1.2.*). This is caused by NB6.9 platform compressing/uncompressing the module jars using pack200.
In order to target the module to the older platform (and still build it using the lates IDE) you need to manually specify the module harness used by the plugins platform (go to “Tools/NetBeans Platforms/” and then select the “Harness” tab and choose the harness that comes from the binaries you can download here.
When you rebuild the module and create the NBM it should work in VisualVM 1.2.* as well as jvisualvm.