We are seeing an older version of a class being used, although we had the latest one deploy. To scan all JAR files in all subfolders of an application server, how do we writ
Now to answer this question here is a simple shell command that did that for us.
for jarFile in $(
ls -R |
awk '
match($0, ".*:") {
folder=$0
}
! match($0, ".*:") {
print folder$0
}' |
grep "\.jar" |
sed -e "s/:/\//g"
);
do
unzip -l $jarFile;
done |
awk '
match($0, "Archive.*") {
jar=$0
}
! match($0, "Archive.*") {
print jar" : "$0
}' |
grep org.jboss.Main
Years ago I wrote a utility classfind to resolve issues like this. Set your classpath to point to your .jar set, and classfind will tell you in which jars it'll find a particular class.
example% classfind -c Document
/usr/java/j2sdk1.4.0/jre/lib/rt.jar -> org.w3c.dom.Document
/usr/java/j2sdk1.4.0/jre/lib/rt.jar -> javax.swing.text.Document