Return-Path: Delivered-To: apmail-struts-commits-archive@minotaur.apache.org Received: (qmail 99485 invoked from network); 5 May 2009 15:10:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 May 2009 15:10:09 -0000 Received: (qmail 89878 invoked by uid 500); 5 May 2009 15:10:09 -0000 Delivered-To: apmail-struts-commits-archive@struts.apache.org Received: (qmail 89802 invoked by uid 500); 5 May 2009 15:10:09 -0000 Mailing-List: contact commits-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list commits@struts.apache.org Received: (qmail 89791 invoked by uid 99); 5 May 2009 15:10:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 15:10:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 May 2009 15:10:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 27DB42388B65; Tue, 5 May 2009 15:09:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r771772 - /struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java Date: Tue, 05 May 2009 15:09:46 -0000 To: commits@struts.apache.org From: wesw@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090505150946.27DB42388B65@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: wesw Date: Tue May 5 15:09:45 2009 New Revision: 771772 URL: http://svn.apache.org/viewvc?rev=771772&view=rev Log: WW-3114, working around GAE class loader incompatibilities, patch from Leonard Broman, thanks! Modified: struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java Modified: struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java?rev=771772&r1=771771&r2=771772&view=diff ============================================================================== --- struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java (original) +++ struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java Tue May 5 15:09:45 2009 @@ -369,10 +369,22 @@ if (parent != null) urlSet = urlSet.exclude(parent); - urlSet = urlSet.exclude(new ClassLoaderInterfaceDelegate(ClassLoader.getSystemClassLoader().getParent())); + try { + // This may fail in some sandboxes, ie GAE + ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader(); + urlSet = urlSet.exclude(new ClassLoaderInterfaceDelegate(systemClassLoader.getParent())); + + } catch (SecurityException e) { + LOG.warn("Could not get the system classloader due to security constraints, there may be improper urls left to scan"); + } urlSet = urlSet.excludeJavaExtDirs(); urlSet = urlSet.excludeJavaEndorsedDirs(); - urlSet = urlSet.excludeJavaHome(); + try { + urlSet = urlSet.excludeJavaHome(); + } catch (NullPointerException e) { + // This happens in GAE since the sandbox contains no java.home directory + LOG.warn("Could not exclude JAVA_HOME, is this a sandbox jvm?"); + } urlSet = urlSet.excludePaths(System.getProperty("sun.boot.class.path", "")); urlSet = urlSet.exclude(".*/JavaVM.framework/.*");