Menu

Issues faced during profiling

Help
Prashant
2008-12-31
2013-05-13
  • Prashant

    Prashant - 2008-12-31

    Hi ,

    I am using Jensor 1.7 to profile my application.

    The application is deployed in the Linux env(Jboss 4.0.3SP1 application server) and I am viewing the output through my windows workstation.I am using the X-server freeXer to view the output of JAW.

    Getting the message below in the Jensor console :

    Reader for file /h/jainp01/Jensor/output/topNMethods.csv closed.
    Reader for file /h/jainp01/Jensor/output/ObjectInst.txt closed.

    It does'nt write the output to the below files :

    topNMethods.csv
    ObjectInst.txt
    JensorProfile.txt

    There are no errors in the server.log of Jboss.

    I am however able to view some of the reports.

    Would like to know why is  Jensor not able to write to the above mentioned files.Is there any configuration I have missed?? .Which all reports will get impacted because of the above mentioned files??

    I dont see any issue when I deploy Jensor and my application in  my local workstation on the windows machine.

    My application structure is as below :

    1. Jar file  -->Contains all the business processing logic,all the DAO's,helper classes ejb's.

    2. War file  --> All the User interface components ,Struts layer ,JSP's and the corresponding Action classes .

    3. Ear file  -->Above mentioned Jar +War are packaged in it.

    Just to summarize the process that I am performing to profile my application in the Linux env :

    1. Instrument the class files in my ejb layer.
    2.Create the ejb jar using the instrumented helper classes.
    3. Create the war file which has dependencies on the ejb layer.
    4. Create the ear file and package both the jar and the war file inside it.
    5. Deploy the ear in the Jboss deply folder.
    6. Start the Session from JAW.
    7. Navigate through the application.

    PS : I have placed the Jensor jar in the Jboss lib folder and also set the JENSOR_HOME variable.

    Please let me know if I should take care of any other step as well.

    Thanks a lot in Advance.

    Regards
    Prshant

     
    • Prashant

      Prashant - 2008-12-31

      Hi ,

        Just to add to the above ,would highly appreciate if you can let me know the below things :

      1. Why do I get the message 'Output not Related to this Project'  and what should I do to avoid this message ??.

      2. Which IP Address to use while collating the records ,the IP address of my local windows workstation or the IP Address of the Linux machine on which Jensor is running and application is deployed??

      Thanks a lot in Advance.

      Regards
      Prashant

       
    • Suresh Malan

      Suresh Malan - 2008-12-31

      Hi Prashant,
          I suppose you are using the windows machine for remote collation of logs from the Linux server.

          When a remote collation is to be done, there are two things to be kept in mind,

      1) The project name used for collation has to be the same as was used for instrumentation.

      2) The remote JAW machine (the windows machine in your case), needs to be in the trusted list of machines on the Jensor server

           For this, you need to take the GUI of JAW on the Linux machine and Go to Administration -> System Admin
           Add the IP Address of the windows machine in the textfield provided, Click on Allow button. This would add the windows machine to the trusted list. Then you can do a remote collation using the windows machine.

           The IP address to be used for collation should be the IP Address of the Linux Server.

           Once the remote collation works, analysis should work.

           Hope this was helpful, revert back if you face further issues.

      Regards,
      Suresh.

       
    • Amol Khanapurkar

      Hi Prashant,

      Regarding your post @2

      1) Jensor, at instrumentation time, inserts the project name inside class bytecode. This is done to identify which output data belongs to what project. When you get 'Output not related to Project', it means you are trying to collate Jensor data from a wrong project.

      For e.g. if you have instrumented a code through Project name Test, then through JAW you can collate only when you are inside the Test project. You would not be able to collate it from any other project say, Test1.

      2)The IP address to be given is that of server where instrumented code is deployed. By default, Jensor opens a TCP / IP server on port 21999 inside this JVM. So in your case, it will be the IP address of JBoss server and port 21999.

      Pls. revert if you have any more queries.

      Cheers,
      Amol

       
    • Prashant

      Prashant - 2009-01-02

      Hi Amol/Sanjay,

      Thank you very much for ur suggestions.
      Today,I tried out to profile the application again ,although Jensor is able to instrument the classes whenever I try to do a Start Session or Collate Records it throws a pop-up saying "There is no Jensor running" .I am not doing anything different and am able to instrument classes using JAW but not able to proceed further because of the above issue.Not sure if it is something to do with the fact that the year changed from 2008 to 2009 ?? .The issue is happening both if I use the Jensor installed in my local Windows Workstation or if I use the one installed on the Remote linux machine.I am using Version 1.7.

      Please let me know if I am missing something.

      Thanks & Regards

      Prashant

       
    • Amol Khanapurkar

      Hi Prashant,

      Have you deployed the instrumented code? The instrumentation, by design, does not touch your existing deployment. In the 'instrumented' folder under the project directory you will find your instrumented code.

      Also apart from deployment, Jensor jar will need to be in classpath of your (JBoss) app server.

      Are these two things satisfied?

      Request you to check the Installation Verification section in Installation manual of Jensor. Just let us know if Jensor works as depicted on the sample application that ships with Jensor.

      We can start troubleshooting your installation, once we verify the things mentioned above.

      Regards,
      Amol

       
    • Prashant

      Prashant - 2009-01-05

      Hi Amol,

      Thanks for ur response.

      I tried to do a fresh installation of Jensor and its intrumenting fine but while collating it gives me the same issue "There is no Jensor running".I have verified all the installation and everything seems to be in line with the installation guide.

      I tried running the demo application in the linux machine and
      faced the below issue :

      sec-dev-lnx01:<!>./demo.sh
      Finding Platform info ...
      Current platform is Linux
      Executing Shell Command
      >>> START_AT_APPLICATION_BOOT=true
      >>> CAPTURE_OBJECT_INSTANTIATION=false
      >>> Currently not capturing Object Instantiations data
      JC-000: Jensor v1.7 is being used
      JC-001: Java Profiler: starting
      Exception in thread "main" java.lang.ExceptionInInitializerError
         at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
         at _Jv_ResolvePoolEntry(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
         at java2d.Java2Demo.<clinit>() (Unknown Source)
         at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
         at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
         at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
         at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
         at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
         at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
         at __gcj_personality_v0 (/amnt/h/jainp01/Jensor/examples/java.version=1.4.2)
         at __libc_start_main (/lib/tls/libc-2.3.4.so)
         at _Jv_RegisterClasses (/amnt/h/jainp01/Jensor/examples/java.version=1.4.2)
      Caused by: java.lang.NullPointerException
         at com.tcs.perc.jensor.core.Profile.<clinit>() (Unknown Source)
         at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
         ...11 more

      Please help me out with the above issue.
      Also let me know if you are available online ,or if we can have a telecon.I am also a TCS associate and need to install this tool on the client site , because of these issues its taking more time than was anticipated earlier.

      Thanks.

       
    • Amol Khanapurkar

      Hi Prashant,

      Jensor could not run because of the Exception thrown. This exception happens because gcj java is used as default JDK. Change it to a Sun or IBM or whatever JVM you are using. It should work.

      Check page 15 of Troubleshooting Guide for more details (#3 java.lang.NoSuchMethodError)

      Regards,
      Amol

       
    • Prashant

      Prashant - 2009-01-07

      Hi Amol,

      Thanks for ur response ,I could fix the issue.
      I collated the data  for one Use case of the application and it worked fine.The files were written in the output folder and I could see the graphs as well.

      However, after that when I tried for the other Use cases which was using the same set of intrumented classes,the files were no more written.

      When I tried to start a new Session,I gave the IP address of the my Local workstation and  could see a popup in the JAW which said the Machine was not trusted to perform the operation on Jensor.Please see that I had already added the IP of my machine in the JAW using the Admin as is stated in the Installation doc.

      So,basically I cud only run the Profiler once and could see the graphs only once.

      To resolve these issues ,can I please request you to please describe how the Start Session /Stop Session and the Collate Records work.?? Which IP needs to be given while doing these operations??.And are there any specific instructions I need to follow before beginning a new Session??

      Also, as per the Installation doc, for remote profiling we need to add a New UserId /passwd in  the Remote machine (using JAW) which needs to be shared with the client machine.Not sure how to create the userid in the Client machine and what significance is the Userid having when we are not using that Userid at any point in time ??

      Is there a file where I can see the Jensor logs ??

      Thanks
      Prashant

       
    • Amol Khanapurkar

      OK Prashant, this is how it works.

      Lets call your JBoss app machine - Linux and your desktop - Windows. Also lets talk about collecting data from app deployed on this JBoss.

      Now the Linux machine needs to trust your Windows to transfer data to Windows. So an entry needs to go into $JENSOR_HOME/config/hosts.all file. One entry per line. You can add this entry in two ways
      1) Directly modify this file using file editors.
      2) Open JAW on Linux and use Administration -> System Admin menu

      Once, Jensor boots (when first instrumented method in JBoss is called) it reads the hosts.all file. Thus the trust will be established at boot-time. Next to perform a 'collate', you need to have an account which is common to both Windows and Linux. The default administrator account that comes with Jensor satisifes this constraint. So use this account.

      Once JAW on your windows sends a collate signal to Linux using say, administrator account, Linux will send the data to windows. After a collate, Linux stops capturing data. So if you want Linux to capture data, send a Start session command through Windows JAW after collation and subsequent analysis is performed.

      Coming back to which IP port to point to while collating :

      IP address: IP address of the machine where your instrumented code is deployed. Linux machine IP in your case.
      Port : 21999, by default, unless you have changed any configuration parameters.

      In a nutshell, the IP shd be of the machine where your instrumented app is running.

      Try, the example application (Java2D) on your local. The collate should work 100% of the time. Once you understnand how local works, it will be simple to understand how remote works.

      Regards,
      Amol

       
    • Prashant

      Prashant - 2009-01-09

      Hi Amol,

      Thanks a lot for all the help rendered.

      Everytime I start my Jboss Server and the Jensor  I am able to generate the reports for the first time ,but after that whenever I try to do a Start Session without bouncing of my Jboss and jensor it does'nt write to the output folder at all even though I give the IP Address of the Remote machine on which the Jensor is running.For every new Session I clean the output folder but it does'nt write.

      Would really apprecite if you can provide the sequence of steps which I should do to profile application for the Second tme (basically when I need to create a new Session).

      Also,please let me know if there is a way to check if there are any errors thrown by the Jensor.

      Thanks
      Prashant

       
    • Suresh Malan

      Suresh Malan - 2009-01-09

      Hi Prashant,
          There could be two conditions:
      1) You may be performing the "Start Session", but not doing any operations because the files get populated only when the methods of the instrumented classes are invoked, not otherwise.
      Also remember to perform the "Collate Records", and then provide the IP Address of the remote machine and port 21999.

      or

      2) You may be checking the output folder of the local machine
      but the files get populated on the remote machine running your JBoss.

         Most probably it will be the first condition.
         Hope this was helpful.
      Regards,
      Suresh.

       
      • Prashant

        Prashant - 2009-01-14

          Hi Suresh,

           Thanks for ur response.I checked the Jboss logs and found that when I create the Session for the second time I get the below error .Would request you to please suggest why the below error is caused :

        16:35:10,451 INFO  [STDOUT] java.lang.NullPointerException
        16:35:10,451 INFO  [STDOUT]         at com.tcs.perc.jensor.core.Profile.run(Profile.java:476)
        16:35:10,451 INFO  [STDOUT]         at java.lang.Thread.run(Thread.java:595)

        Thanks
        Prashant

         
    • Suresh Malan

      Suresh Malan - 2009-01-19

      Hi Prashant,
           I have not been able to recreate the above issue on our side. And would like to know if you were able to replicate the same issue again. Also would like to know the exact steps that led to the above result.
      Regards,
      Suresh.

       

Log in to post a comment.