[opencms-dev] Different version jars in lib folder

Achim Westermann achim.westermann at gmx.de
Thu Apr 14 22:40:47 CEST 2011


Hi Paul,

> For example, all of these:
> lucene-core-1.9.1.jar
> lucene-core-2.1.0.jar
> lucene-core-2.2.0.jar
> lucene-core-2.3.1.jar
> lucene-core-2.3.2.jar
> lucene-core-2.4.1.jar

Most often this is the case for OpenCms installations that have 
undergone at least one update. The setup routine will overwrite previous 
libraries with an empty jar file (size something like 334 bytes, don't 
have this in memory) because in the past deletion of jar files failed 
under some circumstances. It's OK to delete all the tiny jar files.

> (Most of the commons-xxx jars, and a bunch of others as well, are also
> present in multiple versions.)
> What could be the cause of all these multiple versions? Is it safe to
> delete the older versions and just keep the most recent?
> On a side-note:
> Can two different versions of the "same" jar cause conflicts, if they
> reside in the separate webapps' lib folder?
> For example:
> webapp_one/WEB-INF/lib/mylibrary-v1.0.jar
> webapp_two/WEB-INF/lib/mylibrary-v2.0.jar

Indeed this can cause ClassCastExceptions. It's a matter of luck in 
which order the jar files are loaded by the ClassLoaders. Duplicate 
non-empty jar files have to be deleted as you described.

HTH,

Achim




More information about the opencms-dev mailing list