I've just been through a lot of grief installing activemq on Debian Wheezy. apt-get install activemq
installed a lot of packages - openjdk-jre + a raft of libraries, all of which ended up in /usr/share/java as far as I can make out. With a completely basic config, activemq started up fine, but as soon as I added any authentication or authorization sections to my config, it barfed with a NoClassDefFound error for org.objectweb.asm.commons.EmptyVisitor
. This class is definitely provided by /usr/share/java/asm3-all.jar, which is happily installed on my system presumably as a result of the dependencies specified in the activemq package.
So what gives? After a fair bit more digging, it turns out that most of the jars required to operate activemq are also installed directly in /usr/share/activemq/lib
- including asm3.jar, but, crucially, not asm3-all.jar, which includes the offending class. As an experiment, I copied the jar from /usr/share/java/ to the activemq lib directory... and it all worked fine.
So my question is: why on earth did the activemq package install 150+MB of jars in /usr/share/java if it actually doesn't use any of them??? In my days as a Java programmer I would have assumed that an java app would just have to bundle all of its dependencies and be done with it, but the fact that activemq pulls in all these libraries as dependent packages seems to suggest that someone thinks otherwise... or is this just a balls up?