Using Spring Insight with Tomcat 6 - spring

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

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.
Download vFabric tc Server Developer
Create a vFabric tc Server instance which has Insight enabled.
Download the latest Apache Tomcat 6.0.x or 7.0.x
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
Edit conf/server.xml and add the following Valve to the Engine block.
<Valve className="com.springsource.insight.collection.tcserver.request.HttpRequestOperationCollectionValve"/>
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" />
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

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.

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
Download vFabric tc Server Developer
Create a vFabric tc Server instance which has Insight enabled.
Download the latest Apache Tomcat 6.0.x or 7.0.x
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
Start the Tomcat instance.

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.

Related

Can't get Netbeans Project to acknowledge existing Tomcat or Glassfish Server

I haven't been able to figure out what I'm missing here.
I've installed Tomcat and can spin it up fine. (Glassfish too, in my efforts, but I had removed it when I took the screenshot.)
So now I want to hook my project up to the Tomcat instance so I can have Netbeans deploy it for me automatically.
I right-click on my project, go down to Properties. In Project Properties I select 'Run' and go to the drop down to select my server. Only, there's no servers.
Why is it not showing up here? Am I going about this all wrong?
Thanks in advance for any help!
Other potentially useful notes:
* Using Gradle (for my first time)
* Using Spring Boot (for my first time)
* On Windows 10 (don't hate me, I don't love it either)
I was chasing the wrong problem. Spring-boot provides an embedded server so I had no need to install and provide my own.
My real problem was that I had dependencies declared for jpa, postgresql, etc. that I hadn't configured in application.properties. When I tried to run, I'd get an error saying "a problem occurred starting process /path/to/my/jdk/java.exe". I couldn't figure what was going on and, looking around, I saw the issue mentioned in my question about the server.
The solution was to simply comment out the dependencies in my build.gradle until I was ready for them. After I got my PostgreSQL DB set up and added the configureation to application.properties, I was able to un-comment them and it's working great.

Deploy a Ninjaframework application on openshift

Apologies for the vagueness of this question.
Is it possible or, how can a ninjaframework application be deployed on Openshift.
Basically, I have a Ninjaframework application running locally in superdev mode. I can even build a war file. However, when I push it to an Openshift git repository it simply doesn't work. Specifically, I get a vague "Oops. That's an internal server error and all we know." page when I try to access the site.
TBH, I'm not surprised. I need to somehow specify to Openshift how to build the application. I'm hoping this can be done by some Maven configurations etc. but I haven't the faintest idea how?
Any help or pointers very much appreciated.
Yep, cool, thanks guys. I'm afraid i was so clueless on how to do this that logs would only tell me what I already knew; that simply git committing a NinjaFramework application configured to build as a fat jar (by default per the archetype) was never going to work in a Tomcat application server. Apologies if that didn't come across in the question.
I expected some elaborate Maven stuff would be required but luckily I was wrong. It turns out that a simple Maven change was all that was required to have the application deployable in OpenShift (Tomcat 7).
I've outlined the steps here in tutorial form: http://outbottle.com/deploying-a-ninjaframework-application-on-openshift/

Spring 4, STS 3.7 tc server 3.1.1. how to enable insights for my existing web application?

I am new to Spring framework even though i have been a java dev for quite some time. I am impressed by the spring insight application demos in you tube and want to use it in my application. How ever, when i try to create a new tc server using the instructions provided, for windows 8.1 64 bit
tcruntime-instance.bat create --template bio --template insight -i C:\workspaces\eclipses\sts\sts-bundle\pivotal-tc-server-developer-3.1.1.RELEASE\insight-instance http-insight-server-stsdeployed
When i try to add the folder created as the location of the new tc server with insight configured, using STS-> server view-> right click-> new-> server-> selected v3.0-3.1- && server-runtime env->add->browse="newly created server instance directory" it shows me below error.
The Tomcat installation directory is not valid. It is missing expected file or folder tcruntime-ctl.sh.
any idea how to add a new server and run my application on it? or add spring insights to existing spring boot or spring web application thru maven or spring configuration?
Note: Even though im using STS, i would like to know how to use these instances with Eclipse or IntelliJ idea. Im on a windows 8.1 64 bit machine.
When you click "add" from your instructions, you are browsing to a new tc Server installation directory (the binaries you want to run) not the instance directory. Once you select the installation directory of the version you wish to use, you will select next in the configuration and it will give you the option to "Create instance" or use an existing instance. You will then select use an existing instance and point to your newly created instance directory.

Using Railo 3.2 WAR with Tomcat vhosts

I've deployed the railo-3.2.3.000.war and I get the welcome page at http://localhost:8080/railo-3.2.3.000/ which is great but what now? How do I make my CFML-based vhosts actually recognise and use it? In particular, can it be done so all my existing 50+ vhosts share that one deployment and in a way that I can automate new vhosts (like through the manager script interface)?
Do I need to manually edit catalina.properties to load JAR's from /var/lib/tomcat-7/webapps/railo-3.2.3.000/WEB-INF/lib/? Or is there another way?
I'm really trying to avoid modifying Tomcat core files because I want a solution that's easy to roll out to other servers and upgrade in the future.
You probably do not want to use a WAR deployment for multiple virtual hosts. You would generally use a WAR deployment for each virtual host. You want a "global install" or "common classpath" style installation. In a nutshell, this involves dropping Railo JARs in a common Tomcat classpath and adding various servlet (and other) config info from a Railo WAR's web.xml to Tomcat's global web.xml file. There are plenty of guides and blog posts out there if you'd like to handle this manually, but if you don't have a reason to do otherwise, I'd recommend looking at the Vivio Technologies installers:
http://www.viviotech.net/company/installers.cfm
Here's some documentation for the Vivio Railo installer:
http://wiki.getrailo.org/wiki/Installation:InstallerDocumentation
And here's some more installation guides type stuff (potentially a few dated references under there):
http://wiki.getrailo.org/wiki/Railo_Installation
Once you have a global installation set, adding additional virtual hosts is a simple matter of modifying Tomcat's server.xml file with new Host entries. You should find details and examples of this in the above Vivio Railo Installer documentation. You may also be able to use Tomcat Admin Web apps to do the same, but I've always edited server.xml myself, and skipped installing Tomcat Admin apps altogether. HTH!

Tapestry class loader with Tomcat and maven

Is it possible to integrate tapestry for class loading only under tomcat7 and eclipce, if so, how?
I am interesting in that for making java development alot faster.
My project is consists of:
Spring MVC+JSP
Maven
String Security
Mysql
Hibernate
log4j
Tomcat7
Eclipse
helios
ExtJs
I am looking for a stuation where I can save the java file and refresh the browser for seeing results/changes. (Like Jrebel).
Thanks
someone on the mailing list says it's possible, however i haven't gotten it to work 100%. You need to figure out how to point tomcat to various locations to find resources and not copy resources and libraries into the webroot folder. try asking on the mailing list for more instructions.
You need to use Jetty + tapestry for it. And use tomcat7 only to production and tests.
Absolutely it's possible and it works well. We (at tynamo.org) have a whole guide available for using Maven, Eclipse, Tomcat7 and Tapestry together, just follow the steps. Tomcat7 is easily as fast, perhaps faster starting up than Jetty.

Resources