I have tried adding JVM parameter in Websphere server as -javaagent:C:\Program Files\Jensor\lib\jensorjdk15-v22-win32.jar=project=Home=config.file=C:/Program Files/Jensor/config/Jensor.properties.
Also set up the environment variables as
SET TPTP_AC_HOME=C:\IBM\SDPShared\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.4.204.v200910231232\agent_files\win_ia32
SET PATH=%TPTP_AC_HOME%\bin;%TPTP_AC_HOME%\lib;%PATH%
SET JAVA_PROFILER_HOME=C:\IBM\SDPShared\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.4.204.v200910231232\agent_files\win_ia32
SET JENSOR_HOME=C:\Jensor\
But while starting the server I am getting error
JVMJ9TI003E Agent_OnLoad failed for library instrument
Error opening zip file or JAR manifest missing : %JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar"
Please help in resolving this..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
a small correction in JVM parameter
It is set as -javaagent:C:\Jensor\lib\jensorjdk15-v22-win32.jar=project=Home=config.file=C:/Jensor/config/Jensor.properties.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For some reason the environment variable JENSOR_HOME is not being set. Its advisable that the environment variable to be set up at the system level. So when you open a command prompt and type 'set' you should see JENSOR_HOME variable set to C:\Jensor\ . If you dont see that then that is the reason why JENSOR_HOME variable is not gettin resolved from within WCS.
Set the environment variable as a System variable. Even though in javaagent switch you have given fully qualified path of Jensor jar, the code inside the jar needs JENSOR_HOME variable set for it to generate output files. From your WindowsControl Panel please set this variable value to C:\Jensor\ and this should be resolved.
Regards,
Amol
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The javaagent was initially set as -javaagent:%JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar=project=Home=config.file=%JENSOR_HOME%/config/Jensor.properties.
When I gave the full path ie:C:/Jensor…., the error initially occured disappered.
But now another error getting displayed is
java.security.AccessControlException: Access denied (java.io.FilePermission C:\Jensor\config\Jensor.properties read)
at java.security.AccessController.checkPermission(AccessController.java:108)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
at java.lang.SecurityManager.checkRead(SecurityManager.java:883)
at java.io.FileInputStream.<init>(FileInputStream.java:117)
at java.io.FileInputStream.<init>(FileInputStream.java:83)
at com.tcs.perc.jensor.util.ReadProps.<init>(ReadProps.java:60)
at com.tcs.perc.jensor.core.Configurator.configureDynamicParameters(Configurator.java:198)
at com.tcs.perc.jensor.core.Configurator.run(Configurator.java:255)
Jensor.properties is not ready only. I have tried making the Jensor folder as not read only. But still the access denied error coming.
Anything else to be done to resolve the access issue?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is a known security issue with IBM JVM when a javaagent tries to access the file system. Cant remember of the top of my head what the solution is, but the good news is that it is a Google-able problem.
Is there any chance that you can try running WCS Oracle JDK or OpenJDK? There you will not encounter Security issues.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Amol.
The security issue is resolved by granting permission in policy file (C:\IBM\SDP\runtimes\base_v7\java\jre\lib\security\java.policy).
The server starts successfully, but while stating session from JAW Jensor not running error coming. I haven't instrumented classes manually. I am using java version 1.6. So is it necessary to instrument the java classes manually? I have tried adding package name in includelist.txt file.Still same error Jensor not running coming.
Please let me know if i need to manually instrument the classes using JAW.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Rekha - It is not necessary to instrument classes manually from Jensor version 2.x. In fact, it is highly advised not to use manual instrumentation. It exists only for backward compatibility and special cases.
When one gets this error - Jensor not running - it almost always means that instrumented classes are not invoked and hence Jensor data structures are still not instantiated. They get instantiated upon first call to an instrumented method. The only fix for that is to add package names in includelist.txt and then start the App server. If you have modified this file after the App server is up, Jensor will not get a chance to read this file. Jensor reads this file at the JVM boot time and this is the only time it reads it.
Did you try restarting the App server after you made changes to includelist.txt? Try this on sample application - remove java2d package name from and start the demo application. When you try to collate using JAW you will get - Jensor not running - error message. Then shutdown the demo application, and add the package name back in includelist.txt. Run the app. and collate, it will work normally. Try playing around with demo app in this way. That should give you clear clue on how things needs to be done in your environment.
You are just one step away from getting Jensor data. If the problem persists, let me know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Tried all possible ways by adding entries in includelist.txt, then restarting App server etc.. but still no luck
Please let me know if the generic jvm arguments provided is correct
-Xquickstart -javaagent:C:\Jensor\lib\jensorjdk15-v22-win32.jar=project=WC=config.file=C:/Jensor/config/Jensor.properties -cp WebSphereCommerceServerExtensionsLogic
(WebSphereCommerceServerExtensionsLogic contains src and bin folder)
Steps followed
1. Installed Jensor2.2 in C:/Jensor
2. Added environment and system variables needed for jensor
3. Modified server.xml file to add the jvm parameters as mentioned above
4. Added required policy in java.policy file
5. Created a project WC in JAW
6. Started the App server
7. Selected project WC from JAW.
8. Accessed the instrumented class by invoking a view
9. Started session in JAW by localhost/port 21999
10. No Jensor running error message coming.
In Jensor installation path under projects/WC/bin folder there are only 2 files- DebugTrace.properties and temp folder. Is this correct? More files are present in demo/bin of demo project.
Also, I have removed Java2Demo from includetext.txt but still the demo application seems to work fine.
Should I need to add jensorjdk15-v22-win32.jar anywhere else in application folder?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The javaagent switch, I believe has to be first switch and must immediately follow the executable name 'java'. Pls. remove the -Xquickstart before the javaagent. If its absolutely necessary to have this switch, then only add this switch after javaagent. If possible, try to avoid it.
I re-checked Jensor behavior. Its not possible to not have the package name in includelist.txt and still get the data for those packages. I could not reproduce the behaviour you reported. Also, is it possible that you forgot to save the file when you deleted the entry? Finally, the name of the file is includelist.txt not includetext.txt.
Lastly, delete the DO_NOT_INSTRUMENT.txt file or truncate it, if it contains any data. Not that this will help, but extremely remote chances that your application methods, if found here, will not report any profiling data. Let me know if this does not work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I have tried adding JVM parameter in Websphere server as -javaagent:C:\Program Files\Jensor\lib\jensorjdk15-v22-win32.jar=project=Home=config.file=C:/Program Files/Jensor/config/Jensor.properties.
Also set up the environment variables as
SET TPTP_AC_HOME=C:\IBM\SDPShared\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.4.204.v200910231232\agent_files\win_ia32
SET PATH=%TPTP_AC_HOME%\bin;%TPTP_AC_HOME%\lib;%PATH%
SET JAVA_PROFILER_HOME=C:\IBM\SDPShared\plugins\org.eclipse.tptp.platform.jvmti.runtime_4.4.204.v200910231232\agent_files\win_ia32
SET JENSOR_HOME=C:\Jensor\
But while starting the server I am getting error
JVMJ9TI003E Agent_OnLoad failed for library instrument
Error opening zip file or JAR manifest missing : %JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar"
Please help in resolving this..
a small correction in JVM parameter
It is set as -javaagent:C:\Jensor\lib\jensorjdk15-v22-win32.jar=project=Home=config.file=C:/Jensor/config/Jensor.properties.
Hi Rekha,
For some reason the environment variable JENSOR_HOME is not being set. Its advisable that the environment variable to be set up at the system level. So when you open a command prompt and type 'set' you should see JENSOR_HOME variable set to C:\Jensor\ . If you dont see that then that is the reason why JENSOR_HOME variable is not gettin resolved from within WCS.
Set the environment variable as a System variable. Even though in javaagent switch you have given fully qualified path of Jensor jar, the code inside the jar needs JENSOR_HOME variable set for it to generate output files. From your WindowsControl Panel please set this variable value to C:\Jensor\ and this should be resolved.
Regards,
Amol
I am able to see JENSOR_HOME variable set properly as C:\Jensor\ while typing set in command prompt
Cant really think why JENSOR_HOME is not getting resolved from within WCS despite the variable being resolvable by set command.
Can you confirm if the sample / demo application that ships with Jensor, runs?
Hi Amol,
The javaagent was initially set as -javaagent:%JENSOR_HOME%\lib\jensorjdk15-v22-win32.jar=project=Home=config.file=%JENSOR_HOME%/config/Jensor.properties.
When I gave the full path ie:C:/Jensor…., the error initially occured disappered.
But now another error getting displayed is
java.security.AccessControlException: Access denied (java.io.FilePermission C:\Jensor\config\Jensor.properties read)
at java.security.AccessController.checkPermission(AccessController.java:108)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
at java.lang.SecurityManager.checkRead(SecurityManager.java:883)
at java.io.FileInputStream.<init>(FileInputStream.java:117)
at java.io.FileInputStream.<init>(FileInputStream.java:83)
at com.tcs.perc.jensor.util.ReadProps.<init>(ReadProps.java:60)
at com.tcs.perc.jensor.core.Configurator.configureDynamicParameters(Configurator.java:198)
at com.tcs.perc.jensor.core.Configurator.run(Configurator.java:255)
Jensor.properties is not ready only. I have tried making the Jensor folder as not read only. But still the access denied error coming.
Anything else to be done to resolve the access issue?
The sample demo application works fine
Ah ! there you go …
There is a known security issue with IBM JVM when a javaagent tries to access the file system. Cant remember of the top of my head what the solution is, but the good news is that it is a Google-able problem.
Is there any chance that you can try running WCS Oracle JDK or OpenJDK? There you will not encounter Security issues.
Thanks Amol.
The security issue is resolved by granting permission in policy file (C:\IBM\SDP\runtimes\base_v7\java\jre\lib\security\java.policy).
The server starts successfully, but while stating session from JAW Jensor not running error coming. I haven't instrumented classes manually. I am using java version 1.6. So is it necessary to instrument the java classes manually? I have tried adding package name in includelist.txt file.Still same error Jensor not running coming.
Please let me know if i need to manually instrument the classes using JAW.
Rekha - It is not necessary to instrument classes manually from Jensor version 2.x. In fact, it is highly advised not to use manual instrumentation. It exists only for backward compatibility and special cases.
When one gets this error - Jensor not running - it almost always means that instrumented classes are not invoked and hence Jensor data structures are still not instantiated. They get instantiated upon first call to an instrumented method. The only fix for that is to add package names in includelist.txt and then start the App server. If you have modified this file after the App server is up, Jensor will not get a chance to read this file. Jensor reads this file at the JVM boot time and this is the only time it reads it.
Did you try restarting the App server after you made changes to includelist.txt? Try this on sample application - remove java2d package name from and start the demo application. When you try to collate using JAW you will get - Jensor not running - error message. Then shutdown the demo application, and add the package name back in includelist.txt. Run the app. and collate, it will work normally. Try playing around with demo app in this way. That should give you clear clue on how things needs to be done in your environment.
You are just one step away from getting Jensor data. If the problem persists, let me know.
Tried all possible ways by adding entries in includelist.txt, then restarting App server etc.. but still no luck
Please let me know if the generic jvm arguments provided is correct
-Xquickstart -javaagent:C:\Jensor\lib\jensorjdk15-v22-win32.jar=project=WC=config.file=C:/Jensor/config/Jensor.properties -cp WebSphereCommerceServerExtensionsLogic
(WebSphereCommerceServerExtensionsLogic contains src and bin folder)
Steps followed
1. Installed Jensor2.2 in C:/Jensor
2. Added environment and system variables needed for jensor
3. Modified server.xml file to add the jvm parameters as mentioned above
4. Added required policy in java.policy file
5. Created a project WC in JAW
6. Started the App server
7. Selected project WC from JAW.
8. Accessed the instrumented class by invoking a view
9. Started session in JAW by localhost/port 21999
10. No Jensor running error message coming.
In Jensor installation path under projects/WC/bin folder there are only 2 files- DebugTrace.properties and temp folder. Is this correct? More files are present in demo/bin of demo project.
Also, I have removed Java2Demo from includetext.txt but still the demo application seems to work fine.
Should I need to add jensorjdk15-v22-win32.jar anywhere else in application folder?
The javaagent switch, I believe has to be first switch and must immediately follow the executable name 'java'. Pls. remove the -Xquickstart before the javaagent. If its absolutely necessary to have this switch, then only add this switch after javaagent. If possible, try to avoid it.
I re-checked Jensor behavior. Its not possible to not have the package name in includelist.txt and still get the data for those packages. I could not reproduce the behaviour you reported. Also, is it possible that you forgot to save the file when you deleted the entry? Finally, the name of the file is includelist.txt not includetext.txt.
Lastly, delete the DO_NOT_INSTRUMENT.txt file or truncate it, if it contains any data. Not that this will help, but extremely remote chances that your application methods, if found here, will not report any profiling data. Let me know if this does not work.