diff --git a/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java b/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java index fd6384dd1..8239ae0a7 100644 --- a/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java +++ b/src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java @@ -199,7 +199,7 @@ public static CryptoRandom getCryptoRandom(final Properties props) lastException = e; errorMessage.append("CryptoRandom: [" + className + "] failed with " + e.getMessage()); } catch (final ExceptionInInitializerError initializerError) { - Throwable t = initializerError.getException(); + Throwable t = initializerError.getCause(); if (t instanceof Exception) { lastException = (Exception) t; errorMessage.append("CryptoRandom: [" + className + "] initialization failed with " + t.getMessage());