Matt Woodward’s posterous

Matt Woodward’s posterous

Matthew Woodward  //  * CFML, Grails, and Java Developer
* Principal IT Specialist, US Senate
* Open BlueDragon Steering Committee Member
* All-Around Geek

Jun 29 / 8:48am

Tomcat 7 Released

Apache Tomcat 7.0, the latest version of the popular open source Java Web server, is available Tuesday from the Apache Software Foundation.

The upgrade constitutes the first major release of the project since 2006. To ease Web framework integration, version 7.0 implements the Java Servlet 3.0, JavaServer Pages 2.2 and Expression Language 2.2 specifications.

Big changes are the support of Servlet 3.0, JSP 2.2, and EL 2.2, but from what I've read there are lots of nice fixes and performance improvements as well. I'm about to set up two new servers so this is great timing!

Full details at https://blogs.apache.org/tomcat/entry/apache_tomcat_7_released

Filed under // Java Tomcat

Comments (0)

Mar 16 / 6:58am

A New Apache Tomcat Community: TomcatExpert.com | Javalobby

A new site launches today aiming to be the definitive resource for developers who want to run Apache Tomcat in large scale production environments. Sponsored by SpringSource, tomcatexpert.com will provide a central point for the Tomcat community.

Just launched today but given that it's being sponsored by SpringSource, I'm sure this will evolve into a fantastic resource very quickly.

Filed under // Java Tomcat

Comments (1)

Jan 21 / 1:25pm

Apache Releases Tomcat 6.0.24 – What's New

The new stable release of Tomcat 6.0.24 represents six months of open source software development. Version 6.0.24 includes a small number of new features, plus a large amount of important bug fixes and enhancements. This release is an incremental bug fix release, but the number of fixes included in this release is high.

Some very nice stuff in Tomcat 6.0.24, particularly surrounding memory leak handling. I haven't run into issues with memory leaks on 6.0.20 in my own applications, but they did a lot of work in that area.

And a biggie--a native installer for 64-bit Windows. Halle-freakin'-lujah! No more grabbing the exes from SVN and overwriting the ones that come with the 32-bit installer.

Filed under // Java Tomcat

Comments (2)

Dec 18 / 12:20am

Received a Review Copy of Tomcat 6 Developer's Guide

The folks at Packt Publishing contacted me to see if I'd be interested in reviewing their newly published Tomcat 6 Developer's Guide, and being a bit of a Tomcat junkie I jumped at the chance. I downloaded the ebook tonight and I'll be reading it over the next few days, so look for a review soon.

Filed under // Book Reviews Java Tomcat

Comments (0)

Nov 20 / 3:40pm

Monitoring Tomcat with Java VisualVM

One of the best kept secrets that's bundled with your Java 6 JDK is VisualVM. VisualVM is an absolutely fantastic, free monitoring tool for Java that you may not realize is right under your nose.

In a nutshell, when you fire up VisualVM it provides you with a ton of monitoring tools for everything running on the JVM. By default VisualVM will monitor the VM from which it's launched, so if for example you launch VisualVM from the bin directory of jdk1.6.0_17, then anything using that JVM will show up as a process in VisualVM that can be monitored. Note that in some cases certain processes will not appear in VisualVM, which is the real point of this post; I'll get to that in a moment.

I'm attaching a few screenshots to this post. The first shows what VisualVM looks like when I fired it up just now on my Linux laptop, the second shows a snapshot of the main monitor screen (in this case I'm monitoring Tomcat), and the third shows a snapshot of the thread monitoring screen (note the Open BlueDragon threads!). VisualVM can also take and load snapshots so you really hone in on problems at the VM level quite easily.

One major point I'd like to make is that VisualVM will monitor any Java application running on the JVM. So in the CFML world this means if you have OpenBD, Railo, or ColdFusion running, they can all be monitored quite nicely using VisualVM.

VisualVM can also monitor remote JVMs via JMX (Java Management Extensions), so if you're having trouble on a remote server and want to see what's going on, as long as the JMX ports are open and accessible you can launch VisualVM from your local machine and connect to the remote VM. Note that monitoring is a very lightweight process so VisualVM can be used to monitor production servers with virtual no impact. Visual VM also does profiling, however, which is a much more heavyweight process. It provides a huge amount of useful information, but should be used only when absolutely needed on production servers since it will have a noticeable impact on performance.

Now to the real point of this post. When I launched VisualVM on a Windows 2003 server today I was surprised that Tomcat didn't show up as a process running under the VM. Turns out that if you install Tomcat as a service, even if it's running under the same user account that you used to launch VisualVM, Tomcat won't appear by default in the VisualVM process list.

Luckily it's easy enough to resolve. Simply open the Tomcat Configuration application and add the following in the Java Options box on the Java tab:

-Dcom.sun.management.jmxremote.port=8086
-Dcom.sun.management.jmxremote.ssl=false
 -Dcom.sun.management.jmxremote.authenticate=false

After making this change you do have to restart Tomcat.

This will enable JMX in Tomcat and allow VisualVM to connect to it. You can choose any port you like, and note that if you want to use SSL or authentication you would set those options to true. I haven't personally messed with authentication so I'm not sure what that authenticates against, but know that if you want to have JMX available on a production system that you can secure it this way, or of course through firewall rules.

With JMX enabled in Tomcat you then go into VisualVM, add a new JMX connection, and point it to localhost:8086 (or whatever port you set JMX to run on). That's it--you're now monitoring Tomcat!

VisualVM is a great, free tool that you likely already have on your machine, so you really owe it to yourself to check it out.

     
Click here to download:
Monitoring_Tomcat_with_Java_Vi.zip (171 KB)

Comments (14)

Nov 17 / 6:29pm

Running Tomcat as a Service on 64-Bit Windows

I'm replacing one of our ColdFusion 8 installs with Tomcat 6.0.20 and Open BlueDragon, and this is on a 64-bit Windows 2003 server. Easy enough conceptually, but it turns out running Tomcat as a service on 64-bit Windows has a small trick involved.

A couple of potential solutions are outlined on StackOverflow (and numerous other places), but it still involved a bit of hunting around, so I thought a step-by-step with specific links would be helpful both to others and to myself when I forget how to do this next time. ;-)

  1. Install a 64-bit JDK if you haven't already.
  2. Download and run the Windows Service Installer of Tomcat.
    1. Make sure and point to your 64-bit JVM at the appropriate spot in the install process.
    2. At the end of the install, uncheck the box to start Tomcat. It won't start anyway at this point since the startup script included in the download is 32-bit.
  3. Grab the 64-bit versions of tomcat6.exe and tomcat6w.exe from the SVN repository. Even though it says "amd64" in the URL these files work on Intel chips as well.
  4. Replace the tomcat6.exe and tomcat6w.exe in Tomcat's bin directory with the new 64-bit versions you downloaded.
  5. Start up Tomcat!
That should be all there is to it. The one thing that doesn't work for me is the "Monitor Tomcat" application, but that really isn't a big deal since it doesn't do or tell you anything you can't get from the Services panel. I haven't dug into that at all so if anyone knows why that doesn't run I'd be curious to know.

After this is all installed make sure and go into the Tomcat Configuration app to take advantage of all the RAM you need or want to for your applications.

Comments (0)

Nov 6 / 8:18pm

Mark Thomas on Apache Tomcat 7 | Javalobby

the biggest news was probably the timeframe announcement for Apache Tomcat version 7.  According to Jim Jagielski, chairman of the Apache board of directors, Tomcat is used in at least 75% of Java-based websites.  Mark Thomas, a member of the Apache Tomcat Project Management Committee, said that the alpha release of Tomcat 7 is expected in December 2009 or January 2010.  DZone spoke with Thomas for an exclusive interview about the upcoming version of Tomcat. 

Cool new stuff coming in Tomcat 7, and I didn't realize an alpha was so close.

Filed under // Java Tomcat

Comments (0)

Oct 24 / 12:15pm

My Open CFML Presentation from BFusion 2009

Here's a PDF of my "Building and Deploying CFML on an Open Source Stack" presentation from BFusion 2009. The VirtualBox VM we used in the session is available here (2.9 GB zip file), and the user/password on the VM is "floss" (without the quotes) for both. The VM includes:

  • Ubuntu 9.04
  • Java 1.6.0 Update 16
  • MySQL 5
  • Apache
  • Tomcat 6.0.20
  • OpenBD (WAR and pre-deployed)
  • Eclipse with CFEclipse and Subclipse
  • A ColdTonica WAR to practice deployment

The one thing we didn't get to in my session is connecting Apache to Tomcat, but that's simple enough so give me a shout if you have trouble with that.

What we did get to (that I'm glad we did) is monitoring Tomcat and OpenBD with VisualVM, and a lot of people (based on the reaction) seemed not to be aware of that tool.

Once again this is a GREAT conference (I'd be lying if I said Ben Nadel's portion of the keynote didn't get me a little teary eyed) with great technical content and day-long training sessions. If you aren't here this year, get here next year!

Comments (0)

Oct 8 / 10:15am

GlassFish's Record-Setting September Suggests a 'Breakout' | Java.net

GlassFish has just recorded a record-setting September in terms of downloads, registrations, and admin pings. The GlassFish downloads graph is indicative of a "breakout" for GlassFish within the application server market sphere.

I'm still a big Tomcat fan myself, but have others made the switch from Tomcat to Glassfish (or use both)? Any big advantage to Glassfish if I don't need the full JEE bits?

I wonder also if this includes downloads of Glassfish with NetBeans. Since it's the default servlet container with the full version of NetBeans that could skew the numbers a bit.

Filed under // GlassFish Java NetBeans Tomcat

Comments (1)

Sep 8 / 8:51pm

Startup Script for Tomcat on CentOS 5

The final step of my VPS migration was to move the Tomcat startup script I created in /etc/init.d over to the new VPS.

Unfortunately my old script didn't work on CentOS 5. Fortunately, I found this one that does!

So with that, I think I'm finally moved to the new VPS. Couple of lingering issues (MySQL storedprocs, some weird proxying stuff with my blog URL), but overall things went pretty smoothly.

Filed under // Linux Tomcat

Comments (0)