Question
Pegasystems Inc.
US
PEGA
Posted: Mar 11, 2015
Last activity: Jul 17, 2017
Last activity: 17 Jul 2017 16:00 EDT
Closed
Solved
How can i tell if a class from a third party jar that i am trying to import does not conflict with one provided by PRPC?
How can i tell if a class from a third party jar that i am trying to import does not conflict with one provided by PRPC?
***Updated by moderator: Marissa to close post***
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Class name conflict in multiple JARs in server CLASSPATH
In due course of support investigations we have seen many instances "NoClassDefFoundError" arising at runtime due to Class name conflict in duplicate / multiple JAR files picked up by the server's CLASSPATH.
In such situations, its quite a cumbersome process to locate/find the problematic Class under the server's / JVM's file path.
The following is a command which locates and prints the Class name and corresponding JAR file name to an output log file -
In windows -
C:\apache-tomcat-7.0.25> forfiles /S /M *.jar /C "cmd /c jar -tvf @file | findstr /C:"{NameOfClass}.class" && echo @file" > output.log
In UNIX -
$ find . -type f -name '*.jar' -print0 | xargs -0 -I '{}' sh -c 'jar tf {} | grep {NameOfClass}.class && echo {}'