Author: cziegeler
Date: Wed Mar 10 14:58:04 2010
New Revision: 921377

URL: http://svn.apache.org/viewvc?rev=921377&view=rev
Log:
SLING-1435 :  After a NoClassDefError classes are still not found even if they 
have been installed in the meantime with Java 6

Modified:
    
sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java

Modified: 
sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java?rev=921377&r1=921376&r2=921377&view=diff
==============================================================================
--- 
sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java
 (original)
+++ 
sling/trunk/bundles/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/jasper/servlet/JspServletWrapper.java
 Wed Mar 10 14:58:04 2010
@@ -399,6 +399,14 @@ public class JspServletWrapper {
                 (HttpServletResponse.SC_SERVICE_UNAVAILABLE,
                  ex.getMessage());
         } catch (ServletException ex) {
+            // WORKAROUND for SLING-1435
+            // To create a new classloader which reloads the class
+            // we simply remove the old class!
+            if ( ex.getRootCause() instanceof NoClassDefFoundError ) {
+                this.setReload(true);
+                this.ctxt.getCompiler().removeGeneratedClassFiles();
+                this.lastModificationTest = 0;
+            }
             throw handleJspException(ex);
         } catch (IOException ex) {
             throw handleJspException(ex);


Reply via email to