I followed the following steps to set up my Application in Jensor
-> Instrumented my code, japp.war file
-> This created two new folders in my Project PerfAnalysis instrumented and uninstrumented
-> Took the japp.war folder from instrumented\war folder and deployed it in Tomcat.
-> The application consists of only web services (no gui) , which was invoked and was working fine.
This didn't create any entries in the JENSOR_HOME\output folder files. I was also not able to start session from JAW. It doesn't throw up any errror when i give the hostname (localhost) and port no (8080)
What I'm doing wrong here? Any help would be greatly appreciated!
Thanks and Regards,
Ajmal
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What version of Jensor are you using? You seem to be using very old version.
The 2.x series of Jensor does not require manual instrumentation and deployment. By simply adding a -javaagent switch to your Catalina.bat you will be able to instrument classes. Jensor 2.x series does class load-time instrumentation. Manual instrumentation is now provided only for backward compatibility.
Have you used sample application (java2demo)? Please run that to get an idea of how automatic instrumentation works. Then look up appropriate section in User manual for steps to deploy Jensor in Tomcat. It should be pretty simple. If you get stuck, ask, we will be happy to help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-16
Hi Amol,
Thanks for the quick reply. I got confused because in the usage manual, it asked us to do the manual instrumentation. Although I was able to find out the section where we needn't do anything. As a suggestion, probably you can tell something about it in the first section so that the users are aware of it?
I did as you told. Placed my war file into the webapps folder and modified the catalina.bat file. I added a new row for
set JAVA_OPTS=-javaagent:"%JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar"=project=Tomcat=config.file="%JENSOR_HOME%\config\Jensor.properties" -Xms1024M -Xmx1536M
There are two existing ones for JAVA_OPTS. Do I need to modify them or add a new row? Once I did this, the tomcat is failing to start (it's working fiine without the modification). I am using tomcat 6.0.35
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you are using tomcat 6.0.35, then search :doneSetArgs in catalina.bat and add new row as follows exactly below it.
set JAVA_OPTS=-javaagent:"%JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar"=project=Tomcat=config.file="%JENSOR_HOME%\config\Jensor.properties" -Xms1024M -Xmx1536M %JAVA_OPTS%
This will definitely work for you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Since your project name is Tomcat, you will also need to create a project named Tomcat using Jensor Analysis Workbench (Jensor UI) on the machine where Tomcat is running. If there is no syntax error and the project directory exists, Jensor should start at server boot time. You can see Jensor SOPs in catalina logs.
Hope this helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-16
Hi Amol,
I changed the catalina.bat file as you said and also created a project in JAW with the name "Tomcat" as given in config. Then I tried running the startup.bat again, but again it's failing to start and exiting. Any ideas?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It will be really helpful if you can post the error that you are getting in catalina logs. Execute startup.bat from command line and observe the error SOP's from catalina logs.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you upload your catalina.bat or a screenshot / log which captures reason for failure?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-16
The tomcat console just opens and exits without showing any error messages? How do we get the error message? And how do I upload the file? Do you want me to paste the contents of catalina.bat?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-16
Also, do you want me to try with other tomcat versions? if yes, which is the best version to go for which is compatible with Jensor and which requires minimum configuration?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks like your JENSOR_HOME variable is not getting resolved from within catalina.bat. Just do a set JENSOR_HOME="<Your path to Jensor directory>" and try starting Tomcat.
Also just type 'set' on your command prompt and you will see values of all variables including JENSOR_HOME. Just paste that output here on the forum.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-16
I am able to see the JENSOR_HOME set to C:\Program Files\Jensor\ in my environmen variables. Have pasted the content for set.
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\crmdev\Application Data
CATALINA_HOME=D:\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35
CLASS_PATH=D:\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=TCS-DEV-CRM-28
ComSpec=C:\WINDOWS\system32\cmd.exe
DEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopPro
tection
DSLISTEN=LOCAL_OC
DSQUERY=LOCAL_OC
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\crmdev
JAVA_HOME=C:\glassfish3\jdk7
JENSOR_HOME=C:\Program Files\Jensor\
LM_LICENSE_FILE=C:\sybase\SYSAM-1_0\licenses\license.dat
LOGONSERVER=\\TCS-DEV-CRM-28
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=C:\sybase\OCS-12_5\lib3p;C:\sybase\OCS-12_5\dll;C:\sybase\OCS-12_5\bin;C:\s
ybase\SQLRemote\dll;C:\sybase\RPL-12_5\bin;C:\sybase\JS-12_5\bin;C:\sybase\ASE-1
2_5\dll;C:\sybase\ASE-12_5\bin;C:\oraclexe\app\oracle\product\10.2.0\server\bin;
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Tortois
eSVN\bin;C:\windows\System32;C:\Program Files\SQL Anywhere 12\bin32;D:\apache-ma
ven-3.0.4\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 26 Stepping 8, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=1a08
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SQLANY12=C:\Program Files\SQL Anywhere 12
SQLANYSAMP12=C:\Documents and Settings\All Users\Documents\SQL Anywhere 12\Sampl
es
SYBASE=C:\sybase
SYBASE_ASE=ASE-12_5
SYBASE_JRE=C:\sybase\shared-1_0\JRE-1_3
SYBASE_OCS=OCS-12_5
SYBASE_SYSAM=SYSAM-1_0
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEAMCITY_DATA_PATH=C:\Documents and Settings\All Users\JetBrains\TeamCity
TEMP=C:\DOCUME~1\crmdev\LOCALS~1\Temp
TMP=C:\DOCUME~1\crmdev\LOCALS~1\Temp
USERDOMAIN=TCS-DEV-CRM-28
USERNAME=crmdev
USERPROFILE=C:\Documents and Settings\crmdev
VSEDEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\Desktop
Protection
windir=C:\WINDOWS
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Are you using Tomcat in JPDA mode? If not, just add that set JENSOR_HOME statement just before your set JAVA_OPTS statement
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-16
No not in JPDA mode. I did that too. added it just before the JAVA_OPTS which I had added before. So the only change in my catalina.bat would be the below after the :doneSetArg
set JENSOR_HOME=C:\Program Files\Jensor\
set JAVA_OPTS=-javaagent:"%JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar"=project=Tomcat=config.file="%JENSOR_HOME%\config\Jensor.properties" -Xms1024M -Xmx1536M %JAVA_OPTS%
Note: I havent changed the existing set JAVA_OPTS which was there. Hope that isn't a problem
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK. Run your Tomcat from your Apache Tomcat Bin folder as 'catalina.bat run'. This should prevent the window from getting terminated. This way you will see the error. Tell me what error you get.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-16
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now you know what to do :). Your Tomcat is falling short of heap space. Just reduce your -Xms and -Xmx parameters and retry.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-16
Yes ofcourse. It worked! Many Thanks.
Now that it is running, how do I get the data? I just hit one web service but nothing is written to the log file. I also tried to start a session in JAW using localhost/8080 but not able to?
And one more thing is can I set it up in maven configuration? Our project is using maven to manually download tomcat and deploy it in it. Presently for Jensor setup, I am taking the war file generated and placing in another tomcat which I have downloaded and starting it. Is it possible to do some config in maven such that it starts up Jensor as and when I run a clean and install using Maven?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You will figure out that you will need to add classes that you want to be automatically instrumented. To do that you need to add your class or package names e.g. Com.xyz.Myclass1 and com.xyz.Myclass2 can be asked to be instrumented by adding an entry for com.xyz in includelist.txt under %JENSOR_HOME%\config.
Then you need to invoke services that will execute the instrumented classes. Once instrumented classes are executed, data will start appearing in files under output folder. Use Jensor UI to collate performance data. Data for that profiled session will then be shown in UI. You will find all that info in User manual. Once you start getting meaningful data we can think of how to integrate in your build process. First collect data and see if you like what you get.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2013-01-16
Thanks a lot. It did work. Didn't realize that we had to specify the classes to instrument. As a suggestion, you can consider adding an option to specify the packages from UI.
I have started a separate thread for Maven integration. Thanks for your help again
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks . That's a very valid suggestion. Why don't you put in a Feature Request from the Tracker menu above. That way this suggestion can remain tagged to your name.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Amol,
I followed the following steps to set up my Application in Jensor
-> Instrumented my code, japp.war file
-> This created two new folders in my Project PerfAnalysis instrumented and uninstrumented
-> Took the japp.war folder from instrumented\war folder and deployed it in Tomcat.
-> The application consists of only web services (no gui) , which was invoked and was working fine.
This didn't create any entries in the JENSOR_HOME\output folder files. I was also not able to start session from JAW. It doesn't throw up any errror when i give the hostname (localhost) and port no (8080)
What I'm doing wrong here? Any help would be greatly appreciated!
Thanks and Regards,
Ajmal
Hi Ajmal,
What version of Jensor are you using? You seem to be using very old version.
The 2.x series of Jensor does not require manual instrumentation and deployment. By simply adding a -javaagent switch to your Catalina.bat you will be able to instrument classes. Jensor 2.x series does class load-time instrumentation. Manual instrumentation is now provided only for backward compatibility.
Have you used sample application (java2demo)? Please run that to get an idea of how automatic instrumentation works. Then look up appropriate section in User manual for steps to deploy Jensor in Tomcat. It should be pretty simple. If you get stuck, ask, we will be happy to help.
Hi Amol,
Thanks for the quick reply. I got confused because in the usage manual, it asked us to do the manual instrumentation. Although I was able to find out the section where we needn't do anything. As a suggestion, probably you can tell something about it in the first section so that the users are aware of it?
I did as you told. Placed my war file into the webapps folder and modified the catalina.bat file. I added a new row for
set JAVA_OPTS=-javaagent:"%JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar"=project=Tomcat=config.file="%JENSOR_HOME%\config\Jensor.properties" -Xms1024M -Xmx1536M
There are two existing ones for JAVA_OPTS. Do I need to modify them or add a new row? Once I did this, the tomcat is failing to start (it's working fiine without the modification). I am using tomcat 6.0.35
Hi Ajmal,
If you are using tomcat 6.0.35, then search :doneSetArgs in catalina.bat and add new row as follows exactly below it.
set JAVA_OPTS=-javaagent:"%JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar"=project=Tomcat=config.file="%JENSOR_HOME%\config\Jensor.properties" -Xms1024M -Xmx1536M %JAVA_OPTS%
This will definitely work for you.
One more thing Ajmal.
Since your project name is Tomcat, you will also need to create a project named Tomcat using Jensor Analysis Workbench (Jensor UI) on the machine where Tomcat is running. If there is no syntax error and the project directory exists, Jensor should start at server boot time. You can see Jensor SOPs in catalina logs.
Hope this helps.
Hi Amol,
I changed the catalina.bat file as you said and also created a project in JAW with the name "Tomcat" as given in config. Then I tried running the startup.bat again, but again it's failing to start and exiting. Any ideas?
Hi Ajmal,
It will be really helpful if you can post the error that you are getting in catalina logs. Execute startup.bat from command line and observe the error SOP's from catalina logs.
Can you upload your catalina.bat or a screenshot / log which captures reason for failure?
The tomcat console just opens and exits without showing any error messages? How do we get the error message? And how do I upload the file? Do you want me to paste the contents of catalina.bat?
Also, do you want me to try with other tomcat versions? if yes, which is the best version to go for which is compatible with Jensor and which requires minimum configuration?
Looks like your JENSOR_HOME variable is not getting resolved from within catalina.bat. Just do a set JENSOR_HOME="<Your path to Jensor directory>" and try starting Tomcat.
Also just type 'set' on your command prompt and you will see values of all variables including JENSOR_HOME. Just paste that output here on the forum.
I am able to see the JENSOR_HOME set to C:\Program Files\Jensor\ in my environmen variables. Have pasted the content for set.
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\crmdev\Application Data
CATALINA_HOME=D:\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35
CLASS_PATH=D:\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=TCS-DEV-CRM-28
ComSpec=C:\WINDOWS\system32\cmd.exe
DEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\DesktopPro
tection
DSLISTEN=LOCAL_OC
DSQUERY=LOCAL_OC
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\crmdev
JAVA_HOME=C:\glassfish3\jdk7
JENSOR_HOME=C:\Program Files\Jensor\
LM_LICENSE_FILE=C:\sybase\SYSAM-1_0\licenses\license.dat
LOGONSERVER=\\TCS-DEV-CRM-28
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=C:\sybase\OCS-12_5\lib3p;C:\sybase\OCS-12_5\dll;C:\sybase\OCS-12_5\bin;C:\s
ybase\SQLRemote\dll;C:\sybase\RPL-12_5\bin;C:\sybase\JS-12_5\bin;C:\sybase\ASE-1
2_5\dll;C:\sybase\ASE-12_5\bin;C:\oraclexe\app\oracle\product\10.2.0\server\bin;
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Tortois
eSVN\bin;C:\windows\System32;C:\Program Files\SQL Anywhere 12\bin32;D:\apache-ma
ven-3.0.4\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 26 Stepping 8, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=1a08
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SQLANY12=C:\Program Files\SQL Anywhere 12
SQLANYSAMP12=C:\Documents and Settings\All Users\Documents\SQL Anywhere 12\Sampl
es
SYBASE=C:\sybase
SYBASE_ASE=ASE-12_5
SYBASE_JRE=C:\sybase\shared-1_0\JRE-1_3
SYBASE_OCS=OCS-12_5
SYBASE_SYSAM=SYSAM-1_0
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEAMCITY_DATA_PATH=C:\Documents and Settings\All Users\JetBrains\TeamCity
TEMP=C:\DOCUME~1\crmdev\LOCALS~1\Temp
TMP=C:\DOCUME~1\crmdev\LOCALS~1\Temp
USERDOMAIN=TCS-DEV-CRM-28
USERNAME=crmdev
USERPROFILE=C:\Documents and Settings\crmdev
VSEDEFLOGDIR=C:\Documents and Settings\All Users\Application Data\McAfee\Desktop
Protection
windir=C:\WINDOWS
Thanks. So did you try doing set JENSOR_HOME=C:\Program Files\Jensor\ in catalina.bat ? Did that work?
I added set JENSOR_HOME=C:\Program Files\Jensor\ to catalina.bat under set JPDA and ran startup.bat. Still the same result.
Are you using Tomcat in JPDA mode? If not, just add that set JENSOR_HOME statement just before your set JAVA_OPTS statement
No not in JPDA mode. I did that too. added it just before the JAVA_OPTS which I had added before. So the only change in my catalina.bat would be the below after the :doneSetArg
set JENSOR_HOME=C:\Program Files\Jensor\
set JAVA_OPTS=-javaagent:"%JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar"=project=Tomcat=config.file="%JENSOR_HOME%\config\Jensor.properties" -Xms1024M -Xmx1536M %JAVA_OPTS%
Note: I havent changed the existing set JAVA_OPTS which was there. Hope that isn't a problem
OK. Run your Tomcat from your Apache Tomcat Bin folder as 'catalina.bat run'. This should prevent the window from getting terminated. This way you will see the error. Tell me what error you get.
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Now you know what to do :). Your Tomcat is falling short of heap space. Just reduce your -Xms and -Xmx parameters and retry.
Yes ofcourse. It worked! Many Thanks.
Now that it is running, how do I get the data? I just hit one web service but nothing is written to the log file. I also tried to start a session in JAW using localhost/8080 but not able to?
And one more thing is can I set it up in maven configuration? Our project is using maven to manually download tomcat and deploy it in it. Presently for Jensor setup, I am taking the war file generated and placing in another tomcat which I have downloaded and starting it. Is it possible to do some config in maven such that it starts up Jensor as and when I run a clean and install using Maven?
First read up the entire User manual.
You will figure out that you will need to add classes that you want to be automatically instrumented. To do that you need to add your class or package names e.g. Com.xyz.Myclass1 and com.xyz.Myclass2 can be asked to be instrumented by adding an entry for com.xyz in includelist.txt under %JENSOR_HOME%\config.
Then you need to invoke services that will execute the instrumented classes. Once instrumented classes are executed, data will start appearing in files under output folder. Use Jensor UI to collate performance data. Data for that profiled session will then be shown in UI. You will find all that info in User manual. Once you start getting meaningful data we can think of how to integrate in your build process. First collect data and see if you like what you get.
Thanks a lot. It did work. Didn't realize that we had to specify the classes to instrument. As a suggestion, you can consider adding an option to specify the packages from UI.
I have started a separate thread for Maven integration. Thanks for your help again
Thanks . That's a very valid suggestion. Why don't you put in a Feature Request from the Tracker menu above. That way this suggestion can remain tagged to your name.