Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4358

Faulty code while creating _axis2 temp folder!

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Invalid
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: deployment
    • Labels:
      None

      Description

      The following code is faulty when there is no write access - this happens expecially on Unix based environments!
      The first f.mkdirs() is throwing an exception and the recovery else is never called!

      164 File f = new File((File) config.getServletContext().getAttribute("javax.servlet.context.tempdir"), "_axis2");
      165 if (f.exists() || f.mkdirs())

      { 166 param.setValue(f); 167 }

      else {
      168 f = new File(System.getProperty("java.io.tmpdir"), "_axis2");
      169 if (f.exists() || f.mkdirs())

      { 170 param.setValue(f); 171 }

      else

      { 172 throw new DeploymentException("Unable to create a temporary working directory"); 173 }

      174 }

      java.security.AccessControlException: access denied (java.io.FilePermission /opt/glassfish/nodeagents/s4-nodeagent/cluster1s4/generated/jsp/j2ee-apps/C1-axis2/axis2_war/_axis2 write)
      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.SecurityManager.checkWrite(SecurityManager.java:962)
      at java.io.File.mkdir(File.java:1155)
      at java.io.File.mkdirs(File.java:1184)
      at org.apache.axis2.deployment.WarBasedAxisConfigurator.<init>(WarBasedAxisConfigurator.java:165)
      at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:516)
      at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:276)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
      at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:309)
      at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:192)
      at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:145)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1172)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1007)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4808)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:5196)
      at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
      at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:148)
      at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:170)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:955)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1584)
      at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
      at com.sun.enterprise.web.WebContainer.loadJ2EEApplicationWebModules(WebContainer.java:1147)
      at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:141)
      at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
      at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:336)
      at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:210)
      at com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:645)
      at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:928)
      at com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:912)
      at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:461)
      at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
      at com.sun.enterprise.ee.admin.mbeans.ServerRuntimeMBean.forwardEvent(ServerRuntimeMBean.java:95)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
      at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
      at com.sun.enterprise.admin.runtime.BaseRuntimeMBean.invoke(BaseRuntimeMBean.java:462)
      at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
      at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
      at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
      at $Proxy1.invoke(Unknown Source)
      at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
      at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
      at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1426)
      at javax.management.remote.rmi.RMIConnectionImpl.access$200(RMIConnectionImpl.java:72)
      at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1264)
      at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1359)
      at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:788)
      at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
      at sun.rmi.transport.Transport$1.run(Transport.java:159)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
      at java.lang.Thread.run(Thread.java:619)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              theqmaster Q
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: