English 中文(简体)
How to package Java Agent as Visual VM plugin
原标题:

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.

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签