When Tomcat looks different cross Linux flavors

Some days ago at the time I was working on different Linux flavors to setup a uniform solution, I have notified that there are many differences in Tomcat installed files and configuration even when you have same Tomcat version. The mission was setting up a centralized monitoring system that makes user enable to track what is happening within Tomcat and its applications on different Linux machines such as CentOS, FreeBSD and Ubuntu. I was developed the solution in my notebook that uses Ubuntu 9.04, Sun Java 1.6 and Tomcat 6.0. Also I qualified the solution on an Ubuntu server edition. The tests passed perfectly so I tried to migrate it to FreeBSD and CentOS. The system administrator was worry about any major modification on his servers configuration that both were pretty busy. On both FreeBSD and CentOS I had different OS, Java and Tomcat. FreeBSD 7.2 had its own Java runtime and JDK that called Diablo. It used a Tomcat version 5.5. The CentOs machine had an OpenJDK Java edition. Also It uses Tomcat 5.5.
Differences between Sun JDK, OpenJDK and Diablo didn’t make any trouble in using JMX. The biggest incompatibility was different installations of the same version of Tomcat that was installed in different ways by CentOS and FreeBSD package managers!
The administrators has been installed a same version of Tomcat using package managers. It seems each package manager installs a customized version of Tomcat that is more respects to the OS concerns rather than development. In CentOS I didn’t find “catalina.sh” that is a well known startup routine.
Any way JMX listener didn’t work and I guessed that could be caused by different Java editions. Fortunately the administrator rejected my suggestion for using Sun Java on both machine. So I tried other ways.
In latest try I just copied my Tomcat to FreeBSD and CentOS both and it worked like a charm!
Different flavors use their own package managers that install just customized versions of the packages. While any Java developer needs to produce more compatible solutions that are more usable with minor differences cross platforms. Compatibility and scalability are the most advantages of Java over other solutions. This is why we use Java. Every Java developer prefer to keep compatibility over customization.
As a suggestion just use a more secured copy of your own Tomcat over all target servers rather than muted and morphed versions that installed by package managers.
Here is a step by step tutorial of what I have done….

This entry was posted in Java, Linux, Software Engineering. Bookmark the permalink.

Leave a Reply