spring reading System.getenv() which is block by server
We are facing an issue during the deployment of an application into the
CCIX Dev environment(App id is cet).
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
[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.
Permission:
getenv.* : Access denied (java.lang.RuntimePermission getenv.*)
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}
Stack Trace:
java.security.AccessControlException: Access denied
(java.lang.RuntimePermission getenv.*)
We tried to debug this by adding the line below line in was.policy file.
permission java.lang.RuntimePermission "getenv.*";
This is failing as the system does not allow the permission declaration
with a wild character(*).
Also tried adding the below lines in application context file,but still no
luck.
Please assist.
No comments:
Post a Comment