javax.mail Compatibility for Tomcat 5 on CentOS 5


CentOS (Photo credit: Wikipedia)

Some java web applications have compatibility issues with the Tomcat 5 server shipped with CentOS 5.

The first troubleshooting step is to install the official Oracle Java JDK package. Once the JDK is installed, edit your system-wide environment variable “JAVA_HOME” to point to the new package. Your “/etc/profile” file should have the following lines at the bottom (substitute your correct JDK install path):

export JAVA_HOME

I have seen problems with the built-in javax.mail (javamail) breaking web app email capabilities. If this is happening, remove the symbolic link at /var/lib/tomcat5/common/lib/[javamail].jar – this points to the system-provided jar from classpathx-mail package. This will need to be repeated every time the classpathx-mail or tomcat5 packages receive updates. Unfortunately there is no safe way to uninstall classpathx-mail because the tomcat5 package has a dependency that forces both to be removed. If you install tomcat by hand without the system package, you can control every dependency, but it will not be receiving automatic security updates. For changes to take effect, restart tomcat with the following command:

  • service tomcat5 restart

This is an ugly workaround for old software versions distributed with CentOS 5. The real solution is to move to a newer version of the OS – install CentOS 6 and your Java and Tomcat packages will be much newer (better compatibility with many web apps). Good luck!


About notesbytom

Keeping technology notes on to free up my mind to solve new problems rather than figuring out the same ones repeatedly :-).
This entry was posted in Linux, System Administration and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s