Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
fixed a bug which causes NullPointerException in JmxMonitor on some p…
Browse files Browse the repository at this point in the history
…latforms.
  • Loading branch information
jicheng committed Oct 31, 2011
1 parent 6cf430f commit 4be28e7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ private String getUniqueClassloaderIdentifier() {
* @return A string representing the current context path or null if it cannot be determined.
*/
private String getContextPath() {
URL url = getClass().getClassLoader().getResource("/");
ClassLoader loader = getClass().getClassLoader();
if(loader == null)
return null;
URL url = loader.getResource("/");
if (url != null) {
String[] elements = url.toString().split("/");
for (int i = elements.length - 1; i > 0; --i) {
Expand Down

0 comments on commit 4be28e7

Please sign in to comment.