6

I want to use Spring Insight with Tomcat 6. I cant use TC server because of reasons beyond my control. So I am looking at integrating Spring Insight with Tomcat 6. Has any one worked on this before or can any one point me to any documentation.

Thanks, Anuj

Anuj
  • 170
  • 2
  • 9

4 Answers4

8

Insight Developer (the free product) comes in two form, packaged with tc Server Developer and packaged with STS. Neither option will provide an easy mechanism for installing Insight into Tomcat. I'm not saying that it can't be done, there is just no simple way to do it.

If you really want to run Insight on Tomcat then you are going to need to do some work. Here are the rough steps that you'll need to do.

  1. Download vFabric tc Server Developer
  2. Create a vFabric tc Server instance which has Insight enabled.
  3. Download the latest Apache Tomcat 6.0.x or 7.0.x
  4. Copy the following files & folders from the tc Server instance w/Insight

    • bin/setenv.sh
    • bin/insight-bootstrap-tcserver-1.8.3.RELEASE.jar
    • insight
    • lib/*
    • webapps/insight.war
  5. Edit conf/server.xml and add the following Valve to the Engine block.

    <Valve className="com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve"/>

  6. Edit conf/context.xml and add the following before the closing Context tag.

    <Loader loaderClass="com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader" />

    <Listener className="com.springsource.insight.collection.tcserver.lifecycle.ApplicationLifecycleCollectionListener" />

  7. Start the Tomcat instance.

Alternatively, Insight Operations (a paid product) makes this much easier and offers an installer that allows you to easily and quickly add the Insight Agent into different containers, including ASF Tomcat. Here's a link to the documentation.

http://pubs.vmware.com/vfabric51/topic/com.vmware.vfabric.tc-server.2.7/operations/install-agents.html

Daniel Mikusa
  • 10,316
  • 1
  • 15
  • 20
  • Thanks a lot for the steps. Really appreciate it. I will try it out and will let you know how it went. Although, by the looks of it, I think it seems better and easier if I install appdynamics lite or new relic's free agent to do monitoring for my tomcat in dev/test/qa envt. I was playing around with AppDynamics Lite today and it is quite easy to install and get up and running with quickly. Cheers! Anuj – Anuj Sep 17 '12 at 16:49
  • Thanks a lot. you saved my day. – Balaji Paulrajan Apr 22 '14 at 10:35
5

I think this instruction can be helpful for you http://blog.jelastic.com/2012/11/28/application-monitoring-in-the-cloud-with-spring-insight/ Actually in this tutorial Tomcat is a cloud instance, but I guess it is suitable for local installation too.

Marina Sprava
  • 76
  • 1
  • 4
0

I downloaded vfacbric-tc-server-2.9.6 and followed the instructions mentioned by Daniel Mikusa to set up insight on tomcat 7. Unfortunately tomcat was not able to find the classes HttpRequestOperationCollectionValve, TomcatWeavingInsightClassLoader and ApplicationLifecycleCollectionListener in the jars provided. After struggling 2 days adding new jars containing these classes and getting class clash., finally I figured out that just removing the configuration in server.xml and context.xml are sufficient to get insight working on tomcat.

So, all you need to setup insight on tomcat are the steps 1 to 4 and 7 in his answer. I'm copying the same for the ease of others

  1. Download vFabric tc Server Developer
  2. Create a vFabric tc Server instance which has Insight enabled.
  3. Download the latest Apache Tomcat 6.0.x or 7.0.x
  4. Copy the following files & folders from the tc Server instance w/Insight bin/setenv.sh bin/insight-bootstrap-tcserver-1.8.3.RELEASE.jar insight lib/* webapps/insight.war
  5. Start the Tomcat instance.
nagamanojv
  • 271
  • 5
  • 15
-1

I am trying to follow the updated instructions provided by "nagamanojv". I am able to start http://localhost:8080/insight/ on Tomcat 6, but I do not see any applications. I have deployed one of my web applications on the same tomcat instance. Let me know if I am missing anything.

  • I found the solution. I was trying to deploy my web application using the tomcat plugin in IntelliJ and had the insight app deployed straight on Tomcat. When I copied my web application to tomcat webapps folder and started tomcat, I was able to see my application in insight. Hope this helps someone. – Jasmina Desai Apr 09 '15 at 05:00