Unless someone cares strongly about this, I'm going to make it a
documentation issue. "Document that the security manager should be off
during an upgrade."
Begin forwarded message:
> From: Bobby Bissett <bobby.bissett_at_oracle.com>
> Date: March 31, 2010 3:16:13 PM EDT
> To: dev_at_glassfish.dev.java.net
> Subject: asadmin vs security manager during an upgrade
> Reply-To: dev_at_glassfish.dev.java.net
>
> Hi all,
>
> If a v2 domain had the security manager enabled, running a v3
> upgrade on it throws an AccesControlException when the
> System.getEnv() call is made in ASMain#whichPlatform:
>
> --- begin ---
> private static String whichPlatform() {
> String platform = Constants.Platform.Felix.toString(); //
> default is Felix
>
>
> // first check the system props
> String temp =
> System.getProperty(Constants.PLATFORM_PROPERTY_KEY);
> if (temp == null || temp.trim().length() <= 0) {
> // not in sys props -- check environment
> temp = System.getenv(Constants.PLATFORM_PROPERTY_KEY);
> }
>
> if (temp != null && temp.trim().length() != 0) {
> platform = temp.trim();
> }
> return platform;
> }
> --- end ---
>
> Stack trace is, well, obvious:
>
> Exception in thread "main" java.security.AccessControlException:
> access denied (java.lang.RuntimePermission getenv.GlassFish_Platform)
> at
> java
> .security
> .AccessControlContext.checkPermission(AccessControlContext.java:323)
> at
> java.security.AccessController.checkPermission(AccessController.java:
> 546)
> at java.lang.SecurityManager.checkPermission(SecurityManager.java:
> 532)
> at java.lang.System.getenv(System.java:844)
> at
> com
> .sun.enterprise.glassfish.bootstrap.ASMain.whichPlatform(ASMain.java:
> 117)
> at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:61)
>
> My question: is this something we want to deal with, or should we
> just document that the security manager must be turned off during an
> upgrade?
>
> Thanks,
> Bobby
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>