Categories

Tomcat, libtcnative-1 and Ubuntu

Doing same mistakes over and over again is no fun. Faintly knowing what the fault is, and applying a fix to get a solution but still not rectifying your problem, that’s even less fun.

During Tomcat startup, I get this informative message:

org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/i386:/lib:/usr/lib

I reset my Tomcat fairly often cause it’s a development server, so I kept getting reminded of it over and over again. It’s claimed to raise Tomcat performance greatly and do lots of fantastic things. Believing the amazing promises, I decided to reinstall the native library. I used to have it previously on my other server, but didn’t have it installed yet on my new configuration.

Remembering from my previous errors, there was some tweak to be done to get it working right in Ubuntu. After a quick readup, I was reminded that the libtcnative-1 package does not work when IPv6 is enabled. It may have been fixed in the latest SVN sources etc, but it isn’t available yet with apt-get as a Debian/Ubuntu package.  Right now the most recent Tomcat version from apt is 6.0.18 and the Tomcat native library is says “Version: 1.1.16-0ubuntu1″. (I’m not really sure if the IPv6 fix is supposed to be in 1.1.16 or 1.1.17?)

So, how to disable IPv6 then? Funny thing is, none of the old methods apply anymore. It used to be as simple as disabling the module from loading into the kernel, but the 2.6.28-16 kernel I happen to be running has the IPv6 module baked in, so it has to be disabled as a kernel parameter.

This is done by editing /boot/grub/menu.lst

kernel          /boot/vmlinuz-2.6.28-16-generic ro vga=0x317 ipv6.disable=1

I’ve added the ipv6.disable=1 parameter. Who needs IPv6 anyway, my modem+router nor ISP doesn’t support it, and from what I’ve seen others complaining, having it disabled has made DNS lookups faster etc.. There’s no need to have IPv6 enabled for another year I suppose, unless something amazing happens on the Internet or the government pressures everyone to switch over like they did with digital TV broadcast.

After rebooting the system (yes, this is unfortunately required), Tomcat should start up using the native library without any problems. If IPv6 is enabled and you install libtcnative-1, then rebooting Tomcat will fail if you use buggy versions. This may have been fixed in Tomcat 6.0.20 and newer.

1 comment to Tomcat, libtcnative-1 and Ubuntu

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>