title: spring reading System.getenv() which is block by server
body: <p>We are facing an issue during the deployment of an application into the CCIX Dev environment(App id is cet).</p>
  
  <p>We are using Spring framework 3.1.0 as the MVC framework in our application. When we deploy the application, Spring starts initializing its own container. One of the steps during this process is to read all the environment variables. Spring achieves this by invoking a method System.getenv() which will return all the environment variables and the corresponding values in the system. During this step, a security exception is thrown as given below</p>
  
  <p>[8/30/13 1:20:13:965 EDT] 00000014 SecurityManag W   SECJ0314W: Current Java 2 Security policy reported a potential violation of Java 2 Security Permission. Please refer to InfoCenter for further information.</p>
  
  <p>Permission:</p>
  
  <pre><code>  getenv.* : Access denied (java.lang.RuntimePermission getenv.*)
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code> org.springframework.core.env.AbstractEnvironment  in  {file:/opt/httpd/root/apps/cet/ibm/ccix-dev-ear/caseesc.war/WEB-INF/lib/spring-core-3.2.1.RELEASE.jar}
  </code></pre>
  
  <p>Stack Trace:</p>
  
  <p>java.security.AccessControlException: Access denied (java.lang.RuntimePermission getenv.*)</p>
  
  <p>We tried to debug this by adding the line below line in was.policy file. </p>
  
  <p>permission java.lang.RuntimePermission "getenv.*";</p>
  
  <p>This is failing as the system does not allow the permission declaration with a wild character(*).</p>
  
  <p>Also tried adding the below lines in application context file,but still no luck. 
         
         </p>
  
  <p>Please assist.</p>