Service Virtualization

  • 1.  Java Agent Configuration for Eclipse and tomcat

    Posted May 19, 2016 04:04 AM

    Hi Listeners,

     

    I have created a sample web application in eclipse using Servlet and JSP pages and deployed to the tomcat server which I have added to eclipse. Now I have couple of DB method calls in my servlet which I would like to record using CA DevTest. I have added the Java_tools_options variable with the relevant -javaagent string in the Run configurations-->Environment section. I deployed the JSP on to the server which will call the servlet classes. Now when I start my recorder, I don't see the Java agent up and running. I even tried adding the Java_tools_options to the startup.bat in the tomcat installation dir but no luck. Not sure where I'm missing.

     

    But when I tired the same thing in another web project which doesn't have the jsp pages but only servlet classes and directly deploy the servlet classes on the tomcat server with the java agent environment variable set. when I record this time, I was able to see the agent available for recording.

     

    Regards,

    Shivakumar



  • 2.  Re: Java Agent Configuration for Eclipse and tomcat

    Posted May 19, 2016 12:25 PM

    Hi Sdabbiru,

     

    Below are the steps you can follow to configure agent in Tomcat 9.0 JVM.

    1. Copy InsightAgent.jar under JDK_HOME\jre\lib\ext OR JRE_HOME\lib\lib\ext folder .

    2. Set JAVA_OPTS in file starup.bat : set JAVA_OPTS=-javaagent:C:\PROGRA~1\Java\JRE18~1.0_7\lib\ext\InsightAgent.jar=url=tcp://localhost:2009,name=JavaAgent"

    3. Deploy your application in Tomcat and start your tomcat server. You can able to see java agent in Devtest recorder.



  • 3.  Re: Java Agent Configuration for Eclipse and tomcat

    Posted May 20, 2016 05:47 AM

    Thanks Aniket for the inputs.

     

    I tried copying the jar into the path mentioned above and set the JAVA_OPTS in the startup.bat of Tomcat but no luck. When I add the JAVA_OPTS in the startup.bat , tomcat is not starting at all. So I added a setenv,sh file and added it there and Tomcat started but I don't see the agent up and running.

     

    set "JAVA_OPTS=-javaagent:D:\jdk1.7.0_79\jre\lib\ext\InsightAgent.jar=url=tcp://localhost:2009,name=JavaAgent"

    Regards,

    Shivakumar.



  • 4.  Re: Java Agent Configuration for Eclipse and tomcat

    Posted Jan 17, 2017 03:51 PM

    Shivakumar,

     

    Are you still needing assistance with this issue? If so, I will have someone help you out with this issue.

     

    Regards,

    Reid