Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-11297

StandardEnvironment's system environment access produces warning with stacktrace on WebSphere

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 3.2.5
    • Fix Version/s: 3.2.7, 4.0.1
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      We are using Spring 3.2.5 on WAS7.0

      We have the following beans but still we are getting error, can you suggest any alternate.

      <bean id="systemProperties" class="java.util.HashMap" > </bean>
      <bean id="systemEnvironment" class="java.util.HashMap" > </bean>

      Current Java 2 Security policy reported a potential violation of Java 2 Security Permission. Refer to the InfoCenter for further information.

      Permission:

      getenv.* : Access denied (java.lang.RuntimePermission getenv.*)

      Code:

      org.springframework.core.env.AbstractEnvironment in

      {file:/opt/httpd/root/apps/gdr3/ibm7/ccix-dev-ear/gdr3.war/WEB-INF/lib/spring-core-3.2.5.RELEASE.jar}

      Stack Trace:

      java.security.AccessControlException: Access denied (java.lang.RuntimePermission getenv.*)
      at java.security.AccessController.throwACE(AccessController.java:100)
      at java.security.AccessController.checkPermission(AccessController.java:174)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
      at com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:206)
      at java.lang.System.getenv(System.java:688)
      at org.springframework.core.env.AbstractEnvironment.getSystemEnvironment(AbstractEnvironment.java:348)
      at org.springframework.core.env.StandardEnvironment.customizePropertySources(StandardEnvironment.java:79)
      at org.springframework.web.context.support.StandardServletEnvironment.customizePropertySources(StandardServletEnvironment.java:90)
      at org.springframework.core.env.AbstractEnvironment.<init>(AbstractEnvironment.java:114)
      at org.springframework.web.context.support.StandardServletEnvironment.<init>(StandardServletEnvironment.java:44)
      at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.createEnvironment(AbstractRefreshableWebApplicationContext.java:156)
      at org.springframework.context.support.AbstractApplicationContext.getEnvironment(AbstractApplicationContext.java:288)
      at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.resolvePath(AbstractRefreshableConfigApplicationContext.java:122)
      at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.setConfigLocations(AbstractRefreshableConfigApplicationContext.java:80)
      at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.setConfigLocation(AbstractRefreshableConfigApplicationContext.java:68)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:386)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
      at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1718)
      at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:385)
      at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:299)
      at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:100)
      at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:166)
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:732)
      at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:617)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376)
      at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:668)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1128)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1319)
      at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:611)
      at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:944)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:741)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl$3.run(ApplicationMgrImpl.java:2056)
      at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5395)
      at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5483)
      at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
      at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2061)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:389)
      at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:332)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$300(CompositionUnitMgrImpl.java:117)
      at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:899)
      at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:496)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1656)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              sharath Sharath
              Last updater:
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 37 weeks, 4 days ago