I have downloaded the latest version of Jensor i.e. Jensor 1.8. I'm trying to instrument a simple HelloWorld.class, but I'm getting the below error.
My Java version: "1.6.0_10-rc"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
OS: Windows XP
Exception:
Directory : D:\Jensor\projects\appfuse\instrumented\HelloWorld
Path : HelloWorld
LENGTH : 2
Directory : D:\Jensor\projects\appfuse\instrumented\HelloWorld
Path : HelloWorld
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.tcs.perc.jensor.core.TCSPerfClassAdapter.visitMethod(TCSPerfClass
Adapter.java:57)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:743)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:394)
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:418)
at com.tcs.perc.jensor.instrument.InstrumentationListener.actionPerforme
d(InstrumentationListener.java:192)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.tcs.perc.jensor.instrument.writeEntireSelectionListener.getUserPe
rmission(writeEntireSelectionListener.java:185)
at com.tcs.perc.jensor.instrument.writeEntireSelectionListener.actionPer
formed(writeEntireSelectionListener.java:258)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.tcs.perc.jensor.instrument.Instrumenter.getUserSelection(Instrume
nter.java:460)
at com.tcs.perc.jensor.UI.modeInstrument.actionPerformed(modeInstrument.
java:135)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception occurred during event dispatching:
java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String in
dex out of range: -1
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:428)
at com.tcs.perc.jensor.instrument.InstrumentationListener.actionPerforme
d(InstrumentationListener.java:192)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.tcs.perc.jensor.instrument.writeEntireSelectionListener.getUserPe
rmission(writeEntireSelectionListener.java:185)
at com.tcs.perc.jensor.instrument.writeEntireSelectionListener.actionPer
formed(writeEntireSelectionListener.java:258)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.tcs.perc.jensor.instrument.Instrumenter.getUserSelection(Instrume
nter.java:460)
at com.tcs.perc.jensor.UI.modeInstrument.actionPerformed(modeInstrument.
java:135)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range:
-1
at java.lang.String.substring(Unknown Source)
at com.tcs.perc.jensor.core.TCSPerfClassAdapter.visitMethod(TCSPerfClass
Adapter.java:57)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:743)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:394)
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:418)
... 92 more
Looks like the UI misbehaved. Are you repeatedly getting this error?
Jensor's instrumentation has been pretty stable since version 1.0. There is also a command line version of instrumentation utility. You can give it a try. Instructions on using CLI can be found in Usage Manual.
Regards,
Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
D:\Jensor\instrumentation\classes>ClassInstrumentation.bat single
D:\Jensor\instrumentation\classes>java -cp "D:\Jensor\\lib\jensorjdk14-v18-win32
.jar" com.tcs.perc.jensor.core.StaticInstrumenter -p single
Finding Platform info ...
Current platform is Windows XP
Proceeding with instrumentation of classes.
5
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.tcs.perc.jensor.core.TCSPerfClassAdapter.visitMethod(TCSPerfClass
Adapter.java:57)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:743)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:394)
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:418)
at com.tcs.perc.jensor.core.StaticInstrumenter.traverse(StaticInstrument
er.java:329)
at com.tcs.perc.jensor.core.StaticInstrumenter.traverse(StaticInstrument
er.java:314)
at com.tcs.perc.jensor.core.StaticInstrumenter.main(StaticInstrumenter.j
ava:479)
java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String in
dex out of range: -1
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:428)
at com.tcs.perc.jensor.core.StaticInstrumenter.traverse(StaticInstrument
er.java:329)
at com.tcs.perc.jensor.core.StaticInstrumenter.traverse(StaticInstrument
er.java:314)
at com.tcs.perc.jensor.core.StaticInstrumenter.main(StaticInstrumenter.j
ava:479)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range:
-1
at java.lang.String.substring(Unknown Source)
at com.tcs.perc.jensor.core.TCSPerfClassAdapter.visitMethod(TCSPerfClass
Adapter.java:57)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:743)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:394)
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:418)
... 3 more
---------------------------------------------------------------------------------------
This Hello.class has been compiled by Java 6.0.
Does this matter?
Do I need to compile my classes with a particular JVM version?
Can you try to reproduce this at your end i.e. try to instrument a simple single class file?
Appreciate all the help and support.
thnks and rgds,
Basav
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We could reproduce the condition at our end. Looks like Jensor 1.8 has introduced a bug during instrumentation. We will fix it quickly and upload a corrected version on Jensor 1.8.
Can you please file a bug report?
Also, I have verified Jensor 1.7 does work on JDK 1.6. So until we fix the bug, request you to use 1.7. Thanks for bringing to our notice.
Regards,
Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have downloaded Jensor 1.4 and installed it successfully ( Based on the instructions given in Installation Guide- Java2D application works).
The following are settings in startup.bat and demo.bat
@echo OFF
rem Ensure that "java" command below resolves to the desired JVM
@echo ON
C:\jdk1.5.0\bin\java -Xmx64M -cp Java2Demo.jar;"%JENSOR_HOME%\lib\jensorjdk14-v14-win32.jar" java2d.Java2Demo
@echo off
rem Ensure that java command points to appropriate JDK
@echo on
C:\jdk1.5.0\bin\java -Xms256M -Xmx512M -cp .;"%JENSOR_HOME%\lib\jensorjdk14-v14-win32.jar";"%JENSOR_HOME%\lib\jcommon-1.0.5.jar";"%JENSOR_HOME%\lib\jfreechart-1.0.2.jar" com.tcs.perc.jensor.UI.JensorProjectUI
When the Java2D application is instrumented , the following exception is thrown
Finding Platform info ...
Current platform is Windows XP
JC-006: JENSOR_HOME : C:\SW\Jensor\
java.lang.NoSuchMethodError: org.objectweb.asm.jensor.ClassWriter.<init>(I)V
at com.tcs.perc.jensor.UI.InstrumentationListener.actionPerformed(InstrumentationListener.java:268)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
at java.awt.Dialog$1.run(Dialog.java:515)
at java.awt.Dialog.show(Dialog.java:536)
at java.awt.Component.show(Component.java:1300)
at java.awt.Component.setVisible(Component.java:1253)
at com.tcs.perc.jensor.UI.writeEntireSelectionListener.getUserPermission(writeEntireSelectionListener.java:146)
at com.tcs.perc.jensor.UI.writeEntireSelectionListener.actionPerformed(writeEntireSelectionListener.java:219)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
Any solutions for this exception. My JDK version is 1.5
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I have downloaded the latest version of Jensor i.e. Jensor 1.8. I'm trying to instrument a simple HelloWorld.class, but I'm getting the below error.
My Java version: "1.6.0_10-rc"
Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28)
Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing)
OS: Windows XP
Exception:
Directory : D:\Jensor\projects\appfuse\instrumented\HelloWorld
Path : HelloWorld
LENGTH : 2
Directory : D:\Jensor\projects\appfuse\instrumented\HelloWorld
Path : HelloWorld
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.tcs.perc.jensor.core.TCSPerfClassAdapter.visitMethod(TCSPerfClass
Adapter.java:57)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:743)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:394)
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:418)
at com.tcs.perc.jensor.instrument.InstrumentationListener.actionPerforme
d(InstrumentationListener.java:192)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.tcs.perc.jensor.instrument.writeEntireSelectionListener.getUserPe
rmission(writeEntireSelectionListener.java:185)
at com.tcs.perc.jensor.instrument.writeEntireSelectionListener.actionPer
formed(writeEntireSelectionListener.java:258)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.tcs.perc.jensor.instrument.Instrumenter.getUserSelection(Instrume
nter.java:460)
at com.tcs.perc.jensor.UI.modeInstrument.actionPerformed(modeInstrument.
java:135)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception occurred during event dispatching:
java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String in
dex out of range: -1
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:428)
at com.tcs.perc.jensor.instrument.InstrumentationListener.actionPerforme
d(InstrumentationListener.java:192)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.tcs.perc.jensor.instrument.writeEntireSelectionListener.getUserPe
rmission(writeEntireSelectionListener.java:185)
at com.tcs.perc.jensor.instrument.writeEntireSelectionListener.actionPer
formed(writeEntireSelectionListener.java:258)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.tcs.perc.jensor.instrument.Instrumenter.getUserSelection(Instrume
nter.java:460)
at com.tcs.perc.jensor.UI.modeInstrument.actionPerformed(modeInstrument.
java:135)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range:
-1
at java.lang.String.substring(Unknown Source)
at com.tcs.perc.jensor.core.TCSPerfClassAdapter.visitMethod(TCSPerfClass
Adapter.java:57)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:743)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:394)
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:418)
... 92 more
--------------------------------------------------------------
thnks and rgds,
Basav
Hi Basav,
Looks like the UI misbehaved. Are you repeatedly getting this error?
Jensor's instrumentation has been pretty stable since version 1.0. There is also a command line version of instrumentation utility. You can give it a try. Instructions on using CLI can be found in Usage Manual.
Regards,
Amol
Hello Amol,
I'm repeatedly getting this error. I got the same error when I tried to instrument a war file for profiling.
So I tried to instrument a simple HelloWorld.class. But no luck, I still get the same error.
I also tried using the commandline option as suggested by you. But the error persists.
Please see the below error trace:
---------------------------------------------------------------------------------------
Directory of D:\Jensor\instrumentation\classes
11/21/2008 02:04 PM <DIR> .
11/21/2008 02:04 PM <DIR> ..
11/14/2008 01:45 PM 104 ClassInstrumentation.bat
11/20/2008 11:08 AM 415 Hello.class
11/20/2008 10:54 AM <DIR> orig
01/23/2008 03:42 PM 242 ReadMe.txt
3 File(s) 761 bytes
3 Dir(s) 14,225,596,416 bytes free
D:\Jensor\instrumentation\classes>ClassInstrumentation.bat single
D:\Jensor\instrumentation\classes>java -cp "D:\Jensor\\lib\jensorjdk14-v18-win32
.jar" com.tcs.perc.jensor.core.StaticInstrumenter -p single
Finding Platform info ...
Current platform is Windows XP
Proceeding with instrumentation of classes.
5
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(Unknown Source)
at com.tcs.perc.jensor.core.TCSPerfClassAdapter.visitMethod(TCSPerfClass
Adapter.java:57)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:743)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:394)
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:418)
at com.tcs.perc.jensor.core.StaticInstrumenter.traverse(StaticInstrument
er.java:329)
at com.tcs.perc.jensor.core.StaticInstrumenter.traverse(StaticInstrument
er.java:314)
at com.tcs.perc.jensor.core.StaticInstrumenter.main(StaticInstrumenter.j
ava:479)
java.lang.RuntimeException: java.lang.StringIndexOutOfBoundsException: String in
dex out of range: -1
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:428)
at com.tcs.perc.jensor.core.StaticInstrumenter.traverse(StaticInstrument
er.java:329)
at com.tcs.perc.jensor.core.StaticInstrumenter.traverse(StaticInstrument
er.java:314)
at com.tcs.perc.jensor.core.StaticInstrumenter.main(StaticInstrumenter.j
ava:479)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range:
-1
at java.lang.String.substring(Unknown Source)
at com.tcs.perc.jensor.core.TCSPerfClassAdapter.visitMethod(TCSPerfClass
Adapter.java:57)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:743)
at org.objectweb.asm.jensor.ClassReader.accept(ClassReader.java:394)
at com.tcs.perc.jensor.core.StaticInstrumenter.instrument(StaticInstrume
nter.java:418)
... 3 more
---------------------------------------------------------------------------------------
This Hello.class has been compiled by Java 6.0.
Does this matter?
Do I need to compile my classes with a particular JVM version?
Can you try to reproduce this at your end i.e. try to instrument a simple single class file?
Appreciate all the help and support.
thnks and rgds,
Basav
Hi Basav,
We could reproduce the condition at our end. Looks like Jensor 1.8 has introduced a bug during instrumentation. We will fix it quickly and upload a corrected version on Jensor 1.8.
Can you please file a bug report?
Also, I have verified Jensor 1.7 does work on JDK 1.6. So until we fix the bug, request you to use 1.7. Thanks for bringing to our notice.
Regards,
Amol
Thanks Amol for acknowledging the issue.
I have submitted a new bug request (Req No : 2352927)
Meanwhile I will switch to Jensor 1.7 for my profiling.
thnks and rgds.
Basav
Hi,
I have downloaded Jensor 1.4 and installed it successfully ( Based on the instructions given in Installation Guide- Java2D application works).
The following are settings in startup.bat and demo.bat
@echo OFF
rem Ensure that "java" command below resolves to the desired JVM
@echo ON
C:\jdk1.5.0\bin\java -Xmx64M -cp Java2Demo.jar;"%JENSOR_HOME%\lib\jensorjdk14-v14-win32.jar" java2d.Java2Demo
@echo off
rem Ensure that java command points to appropriate JDK
@echo on
C:\jdk1.5.0\bin\java -Xms256M -Xmx512M -cp .;"%JENSOR_HOME%\lib\jensorjdk14-v14-win32.jar";"%JENSOR_HOME%\lib\jcommon-1.0.5.jar";"%JENSOR_HOME%\lib\jfreechart-1.0.2.jar" com.tcs.perc.jensor.UI.JensorProjectUI
When the Java2D application is instrumented , the following exception is thrown
Finding Platform info ...
Current platform is Windows XP
JC-006: JENSOR_HOME : C:\SW\Jensor\ java.lang.NoSuchMethodError: org.objectweb.asm.jensor.ClassWriter.<init>(I)V
at com.tcs.perc.jensor.UI.InstrumentationListener.actionPerformed(InstrumentationListener.java:268)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
at java.awt.Dialog$1.run(Dialog.java:515)
at java.awt.Dialog.show(Dialog.java:536)
at java.awt.Component.show(Component.java:1300)
at java.awt.Component.setVisible(Component.java:1253)
at com.tcs.perc.jensor.UI.writeEntireSelectionListener.getUserPermission(writeEntireSelectionListener.java:146)
at com.tcs.perc.jensor.UI.writeEntireSelectionListener.actionPerformed(writeEntireSelectionListener.java:219)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
Any solutions for this exception. My JDK version is 1.5
Hi,
Pls. post the output of the following command
java -cp "%JENSOR_HOME%\lib\jensorjdk14-v14-win32.jar" com.tcs.perc.jensor.util.SysProps
Also, request to post your question in a separate (your own) thread.
Regards,
Amol