Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0B7F889AA for ; Fri, 2 Sep 2011 00:18:35 +0000 (UTC) Received: (qmail 35206 invoked by uid 500); 2 Sep 2011 00:18:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 35137 invoked by uid 500); 2 Sep 2011 00:18:34 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 35129 invoked by uid 99); 2 Sep 2011 00:18:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2011 00:18:34 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2011 00:18:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 19B2F37C1F for ; Fri, 2 Sep 2011 00:18:10 +0000 (UTC) Date: Fri, 2 Sep 2011 00:18:10 +0000 (UTC) From: "Gary D. Gregory (JIRA)" To: issues@commons.apache.org Message-ID: <1033208254.8912.1314922690101.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <331442065.705.1314009689520.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (LANG-744) StringUtils throws java.security.AccessControlException on Google App Engine MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-744?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D130956= 89#comment-13095689 ]=20 Gary D. Gregory commented on LANG-744: -------------------------------------- Well, I've ruminated, pondered and experimented. Running all unit tests with a security managers results in: Tests run: 2046, Failures: 2, Errors: 115, Skipped: 0 Clearly, we need a good overall solution to avoid 117 new Jiras (an exagger= ation I know.) I've created a JAAS policy file to grant just enough permissions to run the= unit tests in {{src/test/resource/java.policy}} The file contains instructions for using it with JAAS. What this shows is that we should either: # Run all unit tests a second time with JAAS enabled, or # Run all unit tests with JAAS enabled, always We should our solution as a pattern for other Commons component. Specifically for StringUtils, should we have a SunStringUtils? This would l= et you know that you are depending on com.sun code. > StringUtils throws java.security.AccessControlException on Google App Eng= ine > -------------------------------------------------------------------------= --- > > Key: LANG-744 > URL: https://issues.apache.org/jira/browse/LANG-744 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Affects Versions: 3.0.1 > Environment: Google App Engine > Reporter: Cl=C3=A9ment Denis > Fix For: 3.0.2 > > > In the static initializer of org.apache.commons.lang3.StringUtils, there = is an attempt to load the class sun.text.Normalizer. > Such a class is prohibited on Google App Engine, and the static intialize= r throws a java.security.AccessControlException. > {code} > Caused by: java.security.AccessControlException: access denied (java.lang= .RuntimePermission accessClassInPackage.sun.text) > =09at java.security.AccessControlContext.checkPermission(AccessControlCon= text.java:374) > =09at java.security.AccessController.checkPermission(AccessController.jav= a:546) > =09at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) > =09at com.google.appengine.tools.development.DevAppServerFactory$CustomSe= curityManager.checkPermission(DevAppServerFactory.java:166) > =09at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1= 512) > =09at java.lang.Class.checkMemberAccess(Class.java:2164) > =09at java.lang.Class.getMethod(Class.java:1602) > =09at org.apache.commons.lang3.StringUtils.(StringUtils.java:739) > {code} > The exception should be caught in the catch clauses around loadClass("sun= .text.Normalizer"). > Commons lang 2 worked fine on GAE. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira