I am working on a set of simple Java agents to help me (and hopefully others) troubleshoot Java applications. One of the agents that I would like to create JComponent.getToolTipText () tools to quickly identify any GUI class by simply hovering over it.
Here you can find my transformer code and the rest of the project:
http://sfn.cvs.sourceforge.net/viewvc/sfn/core/src/main/java/org/leplus/sfn/transformer/JComponentTransformer.java?view=markup
I run my test GUI with an attached agent as follows:
$ java -javaagent: target / jars / sfn-0.1-agent.jar = JComponent -cp lib / jars / bcel-5.2.jar: target / jars / sfn-0.1-test.jar: target / jars / sfn-0.1- agent.jar org.leplus.sfn.test.Main
sfn-0.1-agent.jar contains the class org.leplus.sfn.transformer.JComponentTransformer. sfn-0.1-test.jar contains the class org.leplus.sfn.test.Main.
This is what the application prints when I launch it and hover over it:
Loading agent: JComponent
Instrumentation ready!
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org / leplus / sfn / tracer / ComponentTracer
at javax.swing.JComponent.getToolTipText (JComponent.java)
at javax.swing.ToolTipManager $ insideTimerAction.actionPerformed (ToolTipManager.java:662)
...
, , JRE, . , org.leplus.sfn.tracer.ComponentTracer. , ComponentTracer , . .
- , - .
,
Tom