Unexpected classloader weirdness

Did you know that in Tomcat 6, you apparently… well, I can’t quite say what the cause is, but here’s what happened:

  • I have a webapp that’s using a library that might be doing some slightly tricky classloader things
  • If I access that app through the AJP connector, it fails to find a class that’s definitely there in my WEB-INF/classes and world-readable
  • If I access that app (from the same URL and in the same state) through the HTTP connector, it finds the class

It must be something to do with classloaders, but I can’t say that I understand any reason why that would happen. Of course, I haven’t investigated it, either, because I’m more interested in getting the thing to work right now than in figuring out what this weirdness is about.

Instead of using mod_jk and JkMount, I’m using mod_proxy_http and ProxyPass. Works well enough for my purposes and avoids whatever this problem is. Maybe sometime I’ll be inspired to dig deeper, because ya know this would turn out to be one of those “wow, I can’t believe these things would all interact in such an unexpected way” things.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.