Author: cziegeler
Date: Tue Jul  7 09:13:36 2009
New Revision: 791764

URL: http://svn.apache.org/viewvc?rev=791764&view=rev
Log:
Improve exception messages.

Modified:
    
sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java

Modified: 
sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java?rev=791764&r1=791763&r2=791764&view=diff
==============================================================================
--- 
sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
 (original)
+++ 
sling/trunk/contrib/scripting/java/src/main/java/org/apache/sling/scripting/java/CompilationContext.java
 Tue Jul  7 09:13:36 2009
@@ -196,12 +196,13 @@
      */
     public Class load()
     throws ServletException, FileNotFoundException {
+        final String name = this.getClassFilePath().substring(1).replace('/', 
'.');
         try {
-            servletClass = 
this.options.getClassLoader().loadClass(this.getClassFilePath().substring(1).replace('/',
 '.'));
+            servletClass = this.options.getClassLoader().loadClass(name);
         } catch (ClassNotFoundException cex) {
-            throw new ServletException("Unable to load servlet class.", cex);
+            throw new ServletException("Servlet class not found: " + name, 
cex);
         } catch (Exception ex) {
-            throw new ServletException("Unable to compile servlet.", ex);
+            throw new ServletException("Unable to compile servlet: " + name, 
ex);
         }
         removed = 0;
         return servletClass;


Reply via email to