3 ms·
This is a very common problem for buggy Java programs that have different versions of the same class on the classpath. The JVM will take the first instance of a
by electrum 13y ago
This is a very common problem for buggy Java programs that have different versions of the same class on the classpath. The JVM will take the first instance of a class it finds on the classpath, so some orders of the classpath will work and others won't.
The solution is to eliminate any duplicate classes from the classpath and to enforce this in your build process. We use this Maven plugin to do it: https://github.com/ning/maven-duplicate-finder-plugin https://github.com/ning/maven-duplicate-finder-plugin
- SanderMak 13y agoOr to properly modularize your application with something like OSGi [1]. No more flat classpath and name collisions will be apparent very early on. [1] http://www.osgi.org/Technology/WhatIsOSGi http://www.osgi.org/Technology/WhatIsOSGi