Author: ajaquith
Date: Tue Apr  7 11:55:02 2009
New Revision: 762714

URL: http://svn.apache.org/viewvc?rev=762714&view=rev
Log:
Added a (String,Throwable) constructor to WikiException and 
WikiSecurityException, and refactored the code so that it is used in preference 
to the (String) constructor where appropriate. This allows more verbose errors 
(and better troubleshooting) because the underlying cause of wrapped Exceptions 
can now be seen. Added some additional stack dumps to the WikiEngine 
initialization code so that odd fatal errors will be printed in server logs. 
This change has been forward-ported to the (3.0) trunk.

Modified:
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/PageManager.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiException.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/AuthorizationManager.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/UserManager.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/WikiSecurityException.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/acl/DefaultAclManager.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/GroupManager.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/XMLGroupDatabase.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/XMLUserDatabase.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginException.java
    
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/util/ClassUtil.java

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/PageManager.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/PageManager.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/PageManager.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/PageManager.java
 Tue Apr  7 11:55:02 2009
@@ -168,17 +168,17 @@
         catch( ClassNotFoundException e )
         {
             log.error("Unable to locate provider class '"+classname+"'",e);
-            throw new WikiException("no provider class");
+            throw new WikiException( "No provider class.", e );
         }
         catch( InstantiationException e )
         {
             log.error("Unable to create provider class '"+classname+"'",e);
-            throw new WikiException("faulty provider class");
+            throw new WikiException( "Faulty provider class.", e );
         }
         catch( IllegalAccessException e )
         {
             log.error("Illegal access to provider class '"+classname+"'",e);
-            throw new WikiException("illegal provider class");
+            throw new WikiException( "Illegal provider class.", e );
         }
         catch( NoRequiredPropertyException e )
         {
@@ -189,7 +189,7 @@
         catch( IOException e )
         {
             log.error("An I/O exception occurred while trying to create a new 
page provider: "+classname, e );
-            throw new WikiException("Unable to start page provider: 
"+e.getMessage());
+            throw new WikiException( "Unable to start page provider: 
"+e.getMessage(), e );
         }
 
     }

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiEngine.java
 Tue Apr  7 11:55:02 2009
@@ -406,7 +406,7 @@
             {
                 context.log( msg );
             }
-            throw new WikiException( msg );
+            throw new WikiException( msg, e );
         }
     }
 
@@ -595,29 +595,33 @@
         {
             // RuntimeExceptions may occur here, even if they shouldn't.
             log.fatal( "Failed to start managers.", e );
-            throw new WikiException( "Failed to start managers: 
"+e.getMessage() );
+            e.printStackTrace();
+            throw new WikiException( "Failed to start managers: 
"+e.getMessage(), e );
         }
         catch (ClassNotFoundException e)
         {
             log.fatal( "JSPWiki could not start, URLConstructor was not found: 
",e );
-            throw new WikiException(e.getMessage());
+            e.printStackTrace();
+            throw new WikiException(e.getMessage(), e );
         }
         catch (InstantiationException e)
         {
             log.fatal( "JSPWiki could not start, URLConstructor could not be 
instantiated: ",e );
-            throw new WikiException(e.getMessage());
+            e.printStackTrace();
+            throw new WikiException(e.getMessage(), e );
         }
         catch (IllegalAccessException e)
         {
             log.fatal( "JSPWiki could not start, URLConstructor cannot be 
accessed: ",e );
-            throw new WikiException(e.getMessage());
+            e.printStackTrace();
+            throw new WikiException(e.getMessage(), e );
         }
         catch( Exception e )
         {
             // Final catch-all for everything
-            
             log.fatal( "JSPWiki could not start, due to an unknown exception 
when starting.",e );
-            throw new WikiException("Failed to start; please check log files 
for better information.");
+            e.printStackTrace();
+            throw new WikiException("Failed to start; please check log files 
for better information.", e );
         }
         
         //

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiException.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiException.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiException.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/WikiException.java
 Tue Apr  7 11:55:02 2009
@@ -33,10 +33,21 @@
     /**
      *  Constructs an exception.
      *  
-     *  @param msg The message in the exception.
+     *  @param msg the message in the exception.
      */
     public WikiException( String msg )
     {
-        super(msg);
+        super( msg );
+    }
+    
+    /**
+     *  Constructs an exception with a supplied cause.
+     *  
+     *  @param msg the message in the exception.
+     *  @param cause the cause of the exception
+     */
+    public WikiException( String msg, Throwable cause )
+    {
+        super( msg, cause );
     }
 }

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/AuthorizationManager.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/AuthorizationManager.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/AuthorizationManager.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/AuthorizationManager.java
 Tue Apr  7 11:55:02 2009
@@ -431,7 +431,7 @@
         catch ( PolicyException e )
         {
             log.error("Could not initialize local security policy: " + 
e.getMessage() );
-            throw new WikiException( e.getMessage() );
+            throw new WikiException( "Could not initialize local security 
policy: " + e.getMessage(), e );
         }
     }
 
@@ -473,17 +473,17 @@
             catch( ClassNotFoundException e )
             {
                 log.fatal( "Authorizer " + clazz + " cannot be found", e );
-                throw new WikiException( "Authorizer " + clazz + " cannot be 
found" );
+                throw new WikiException( "Authorizer " + clazz + " cannot be 
found", e );
             }
             catch( InstantiationException e )
             {
                 log.fatal( "Authorizer " + clazz + " cannot be created", e );
-                throw new WikiException( "Authorizer " + clazz + " cannot be 
created" );
+                throw new WikiException( "Authorizer " + clazz + " cannot be 
created", e );
             }
             catch( IllegalAccessException e )
             {
                 log.fatal( "You are not allowed to access this authorizer 
class", e );
-                throw new WikiException( "You are not allowed to access this 
authorizer class" );
+                throw new WikiException( "You are not allowed to access this 
authorizer class", e );
             }
         }
 

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/UserManager.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/UserManager.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/UserManager.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/UserManager.java
 Tue Apr  7 11:55:02 2009
@@ -370,7 +370,7 @@
             }
             catch ( WikiException e )
             {
-                throw new WikiSecurityException( e.getMessage() );
+                throw new WikiSecurityException( e.getMessage(), e );
             }
 
             // Alert all listeners that the profile changed...

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/WikiSecurityException.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/WikiSecurityException.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/WikiSecurityException.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/WikiSecurityException.java
 Tue Apr  7 11:55:02 2009
@@ -40,6 +40,16 @@
      */
     public WikiSecurityException( String msg )
     {
-        super(msg);
+        super( msg );
+    }
+    
+    /**
+     *  Constructs an exception with a supplied cause.
+     *  @param msg the message to supply to the exception
+     *  @param the cause
+     */
+    public WikiSecurityException( String msg, Throwable cause )
+    {
+        super( msg, cause );
     }
 }

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/acl/DefaultAclManager.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/acl/DefaultAclManager.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/acl/DefaultAclManager.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/acl/DefaultAclManager.java
 Tue Apr  7 11:55:02 2009
@@ -134,11 +134,11 @@
         catch( NoSuchElementException nsee )
         {
             log.warn( "Invalid access rule: " + ruleLine + " - defaults will 
be used." );
-            throw new WikiSecurityException( "Invalid access rule: " + 
ruleLine );
+            throw new WikiSecurityException( "Invalid access rule: " + 
ruleLine, nsee );
         }
         catch( IllegalArgumentException iae )
         {
-            throw new WikiSecurityException( "Invalid permission type: " + 
ruleLine );
+            throw new WikiSecurityException( "Invalid permission type: " + 
ruleLine, iae );
         }
 
         return acl;
@@ -233,7 +233,7 @@
         }
         catch ( ProviderException e )
         {
-            throw new WikiSecurityException( "Could not set Acl. Reason: 
ProviderExcpetion " + e.getMessage() );
+            throw new WikiSecurityException( "Could not set Acl. Reason: 
ProviderExcpetion " + e.getMessage(), e );
         }
     }
 

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/GroupManager.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/GroupManager.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/GroupManager.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/GroupManager.java
 Tue Apr  7 11:55:02 2009
@@ -181,7 +181,7 @@
 
         if( dbInstantiationError != null )
         {
-            throw new WikiSecurityException( dbInstantiationError + " Cause: " 
+ (cause != null ? cause.getMessage() : "") );
+            throw new WikiSecurityException( dbInstantiationError + " Cause: " 
+ (cause != null ? cause.getMessage() : ""), cause );
         }
 
         return m_groupDatabase;
@@ -219,7 +219,7 @@
         }
         catch ( WikiException e )
         {
-            throw new WikiSecurityException( e.getMessage() );
+            throw new WikiSecurityException( e.getMessage(), e );
         }
 
         // Load all groups from the database into the cache
@@ -562,10 +562,10 @@
                 {
                     m_groups.put( oldGroup.getPrincipal(), oldGroup );
                 }
-                throw new WikiSecurityException( e.getMessage() + " (rolled 
back to previous version)." );
+                throw new WikiSecurityException( e.getMessage() + " (rolled 
back to previous version).", e );
             }
             // Re-throw security exception
-            throw new WikiSecurityException( e.getMessage() );
+            throw new WikiSecurityException( e.getMessage(), e );
         }
     }
 

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/JDBCGroupDatabase.java
 Tue Apr  7 11:55:02 2009
@@ -294,7 +294,7 @@
         }
         catch( SQLException e )
         {
-            throw new WikiSecurityException( "Could not delete group " + 
groupName + ": " + e.getMessage() );
+            throw new WikiSecurityException( "Could not delete group " + 
groupName + ": " + e.getMessage(), e );
         }
         finally
         {
@@ -352,7 +352,7 @@
         }
         catch( SQLException e )
         {
-            throw new WikiSecurityException( e.getMessage() );
+            throw new WikiSecurityException( e.getMessage(), e );
         }
         finally
         {
@@ -461,7 +461,7 @@
         }
         catch( SQLException e )
         {
-            throw new WikiSecurityException( e.getMessage() );
+            throw new WikiSecurityException( e.getMessage(), e );
         }
         finally
         {

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/XMLGroupDatabase.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/XMLGroupDatabase.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/XMLGroupDatabase.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/authorize/XMLGroupDatabase.java
 Tue Apr  7 11:55:02 2009
@@ -449,7 +449,7 @@
         }
         catch( IOException e )
         {
-            throw new WikiSecurityException( e.getLocalizedMessage() );
+            throw new WikiSecurityException( e.getLocalizedMessage(), e );
         }
 
         // Copy new file over old version

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/JDBCUserDatabase.java
 Tue Apr  7 11:55:02 2009
@@ -341,7 +341,7 @@
         }
         catch( SQLException e )
         {
-            throw new WikiSecurityException( e.getMessage() );
+            throw new WikiSecurityException( e.getMessage(), e );
         }
         finally
         {
@@ -428,7 +428,7 @@
         }
         catch( SQLException e )
         {
-            throw new WikiSecurityException( e.getMessage() );
+            throw new WikiSecurityException( e.getMessage(), e );
         }
         finally
         {
@@ -646,7 +646,7 @@
         }
         catch( SQLException e )
         {
-            throw new WikiSecurityException( e.getMessage() );
+            throw new WikiSecurityException( e.getMessage(), e );
         }
         finally
         {
@@ -728,7 +728,7 @@
                 }
                 catch ( IOException e )
                 {
-                    throw new WikiSecurityException( "Could not save user 
profile attribute. Reason: " + e.getMessage() );
+                    throw new WikiSecurityException( "Could not save user 
profile attribute. Reason: " + e.getMessage(), e );
                 }
                 ps.setTimestamp( 9, ts );
                 ps.execute();
@@ -773,7 +773,7 @@
                 }
                 catch ( IOException e )
                 {
-                    throw new WikiSecurityException( "Could not save user 
profile attribute. Reason: " + e.getMessage() );
+                    throw new WikiSecurityException( "Could not save user 
profile attribute. Reason: " + e.getMessage(), e );
                 }
                 ps.setDate( 9, lockExpiry );
                 ps.setString( 10, profile.getLoginName() );
@@ -791,7 +791,7 @@
         }
         catch( SQLException e )
         {
-            throw new WikiSecurityException( e.getMessage() );
+            throw new WikiSecurityException( e.getMessage(), e );
         }
         finally
         {

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/XMLUserDatabase.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/XMLUserDatabase.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/XMLUserDatabase.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/auth/user/XMLUserDatabase.java
 Tue Apr  7 11:55:02 2009
@@ -398,7 +398,7 @@
         }
         catch ( IOException e )
         {
-            throw new WikiSecurityException( e.getLocalizedMessage() );
+            throw new WikiSecurityException( e.getLocalizedMessage(), e );
         }
 
         // Copy new file over old version
@@ -579,7 +579,7 @@
             }
             catch ( IOException e )
             {
-                throw new WikiSecurityException( "Could not save user profile 
attribute. Reason: " + e.getMessage() );
+                throw new WikiSecurityException( "Could not save user profile 
attribute. Reason: " + e.getMessage(), e );
             }
         }
 

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginException.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginException.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginException.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/plugin/PluginException.java
 Tue Apr  7 11:55:02 2009
@@ -52,7 +52,7 @@
      */
     public PluginException( String message, Throwable original )
     {
-        super( message );
+        super( message, original );
         m_throwable = original;
     }
 

Modified: 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/util/ClassUtil.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/util/ClassUtil.java?rev=762714&r1=762713&r2=762714&view=diff
==============================================================================
--- 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/util/ClassUtil.java
 (original)
+++ 
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/util/ClassUtil.java
 Tue Apr  7 11:55:02 2009
@@ -291,25 +291,25 @@
         {
             log.info( "Cannot instantiate requested class "+requestedClass, e 
);
             
-            throw new WikiException("Failed to instantiate class 
"+requestedClass);
+            throw new WikiException("Failed to instantiate class 
"+requestedClass, e );
         }
         catch (IllegalAccessException e)
         {
             log.info( "Cannot access requested class "+requestedClass, e );
             
-            throw new WikiException("Failed to instantiate class 
"+requestedClass);
+            throw new WikiException("Failed to instantiate class 
"+requestedClass, e );
         }
         catch (IllegalArgumentException e)
         {
             log.info( "Illegal arguments when constructing new object", e );
             
-            throw new WikiException("Failed to instantiate class 
"+requestedClass);
+            throw new WikiException("Failed to instantiate class 
"+requestedClass, e );
         }
         catch (InvocationTargetException e)
         {
             log.info( "You tried to instantiate an abstract class 
"+requestedClass, e );
             
-            throw new WikiException("Failed to instantiate class 
"+requestedClass);
+            throw new WikiException("Failed to instantiate class 
"+requestedClass, e );
         }
     }
 
@@ -341,7 +341,7 @@
         {
             log.info( "Cannot find requested class", e );
             
-            throw new WikiException("Failed to instantiate class 
"+requestedClass);
+            throw new WikiException("Failed to instantiate class 
"+requestedClass, e );
         }
     }
 }


Reply via email to