java.io.IOException: Unable to write to deploy directory

Spring JIRA | Karol Dowbecki | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When Spring XD is started as a service using {{service spring-xd-container start}} the deploy-working-dir in GemFire module is resolved to the top-most directory (on Linux "/"). This directory is not writable by spring-xd user under which the process is executed. When a stream using GemFire is created e.g. {{stream create --name gfTest --definition "time | gemfire-json-server ...}} following exception will be thrown: {code} [error 2015/03/24 15:55:20.798 GMT <DeploymentsPathChildrenCache-0> tid=0x34] Error when attempting to deploy JAR files on load. java.io.IOException: Unable to write to deploy directory at com.gemstone.gemfire.internal.JarDeployer.verifyWritableDeployDirectory(JarDeployer.java:589) at com.gemstone.gemfire.internal.JarDeployer.loadPreviouslyDeployedJars(JarDeployer.java:68) at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.init(GemFireCacheImpl.java:839) at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:620) at com.gemstone.gemfire.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:207) at com.gemstone.gemfire.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:162) at org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:93) at org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:271) at org.springframework.data.gemfire.CacheFactoryBean.getObject(CacheFactoryBean.java:455) at org.springframework.data.gemfire.CacheFactoryBean.getObject(CacheFactoryBean.java:77) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1469) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:743) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139) at org.springframework.xd.module.core.SimpleModule.initialize(SimpleModule.java:214) at org.springframework.xd.dirt.module.ModuleDeployer.doDeploy(ModuleDeployer.java:217) at org.springframework.xd.dirt.module.ModuleDeployer.deploy(ModuleDeployer.java:200) at org.springframework.xd.dirt.server.DeploymentListener.deployModule(DeploymentListener.java:363) at org.springframework.xd.dirt.server.DeploymentListener.deployStreamModule(DeploymentListener.java:332) at org.springframework.xd.dirt.server.DeploymentListener.onChildAdded(DeploymentListener.java:179) at org.springframework.xd.dirt.server.DeploymentListener.childEvent(DeploymentListener.java:147) at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:509) at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:503) at org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:92) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297) at org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:83) at org.apache.curator.framework.recipes.cache.PathChildrenCache.callListeners(PathChildrenCache.java:500) at org.apache.curator.framework.recipes.cache.EventOperation.invoke(EventOperation.java:35) at org.apache.curator.framework.recipes.cache.PathChildrenCache$10.run(PathChildrenCache.java:762) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {code} deploy-working-dir should be set to a directory which writable by spring-xd user (maybe java.io.tmpdir?).

    Spring JIRA | 2 years ago | Karol Dowbecki
    java.io.IOException: Unable to write to deploy directory
  2. 0

    When Spring XD is started as a service using {{service spring-xd-container start}} the deploy-working-dir in GemFire module is resolved to the top-most directory (on Linux "/"). This directory is not writable by spring-xd user under which the process is executed. When a stream using GemFire is created e.g. {{stream create --name gfTest --definition "time | gemfire-json-server ...}} following exception will be thrown: {code} [error 2015/03/24 15:55:20.798 GMT <DeploymentsPathChildrenCache-0> tid=0x34] Error when attempting to deploy JAR files on load. java.io.IOException: Unable to write to deploy directory at com.gemstone.gemfire.internal.JarDeployer.verifyWritableDeployDirectory(JarDeployer.java:589) at com.gemstone.gemfire.internal.JarDeployer.loadPreviouslyDeployedJars(JarDeployer.java:68) at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.init(GemFireCacheImpl.java:839) at com.gemstone.gemfire.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:620) at com.gemstone.gemfire.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:207) at com.gemstone.gemfire.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:162) at org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:93) at org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:271) at org.springframework.data.gemfire.CacheFactoryBean.getObject(CacheFactoryBean.java:455) at org.springframework.data.gemfire.CacheFactoryBean.getObject(CacheFactoryBean.java:77) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1469) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:743) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139) at org.springframework.xd.module.core.SimpleModule.initialize(SimpleModule.java:214) at org.springframework.xd.dirt.module.ModuleDeployer.doDeploy(ModuleDeployer.java:217) at org.springframework.xd.dirt.module.ModuleDeployer.deploy(ModuleDeployer.java:200) at org.springframework.xd.dirt.server.DeploymentListener.deployModule(DeploymentListener.java:363) at org.springframework.xd.dirt.server.DeploymentListener.deployStreamModule(DeploymentListener.java:332) at org.springframework.xd.dirt.server.DeploymentListener.onChildAdded(DeploymentListener.java:179) at org.springframework.xd.dirt.server.DeploymentListener.childEvent(DeploymentListener.java:147) at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:509) at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:503) at org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:92) at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297) at org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:83) at org.apache.curator.framework.recipes.cache.PathChildrenCache.callListeners(PathChildrenCache.java:500) at org.apache.curator.framework.recipes.cache.EventOperation.invoke(EventOperation.java:35) at org.apache.curator.framework.recipes.cache.PathChildrenCache$10.run(PathChildrenCache.java:762) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) {code} deploy-working-dir should be set to a directory which writable by spring-xd user (maybe java.io.tmpdir?).

    Spring JIRA | 2 years ago | Karol Dowbecki
    java.io.IOException: Unable to write to deploy directory

    Root Cause Analysis

    1. java.io.IOException

      Unable to write to deploy directory

      at com.gemstone.gemfire.internal.JarDeployer.verifyWritableDeployDirectory()
    2. com.gemstone.gemfire
      ClientCacheFactory.create
      1. com.gemstone.gemfire.internal.JarDeployer.verifyWritableDeployDirectory(JarDeployer.java:589)
      2. com.gemstone.gemfire.internal.JarDeployer.loadPreviouslyDeployedJars(JarDeployer.java:68)
      3. com.gemstone.gemfire.internal.cache.GemFireCacheImpl.init(GemFireCacheImpl.java:839)
      4. com.gemstone.gemfire.internal.cache.GemFireCacheImpl.create(GemFireCacheImpl.java:620)
      5. com.gemstone.gemfire.cache.client.ClientCacheFactory.basicCreate(ClientCacheFactory.java:207)
      6. com.gemstone.gemfire.cache.client.ClientCacheFactory.create(ClientCacheFactory.java:162)
      6 frames
    3. Spring Data GemFire
      CacheFactoryBean.getObject
      1. org.springframework.data.gemfire.client.ClientCacheFactoryBean.createCache(ClientCacheFactoryBean.java:93)
      2. org.springframework.data.gemfire.CacheFactoryBean.init(CacheFactoryBean.java:271)
      3. org.springframework.data.gemfire.CacheFactoryBean.getObject(CacheFactoryBean.java:455)
      4. org.springframework.data.gemfire.CacheFactoryBean.getObject(CacheFactoryBean.java:77)
      4 frames
    4. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168)
      2. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
      3. org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1517)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:251)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      6. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:351)
      7. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
      8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1469)
      9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
      10. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
      11. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
      12. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
      13. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      14. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
      15. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      16. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:743)
      16 frames
    5. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
      2 frames
    6. Spring Boot
      SpringApplicationBuilder.run
      1. org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691)
      2. org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
      3. org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139)
      3 frames
    7. org.springframework.xd
      DeploymentListener.childEvent
      1. org.springframework.xd.module.core.SimpleModule.initialize(SimpleModule.java:214)
      2. org.springframework.xd.dirt.module.ModuleDeployer.doDeploy(ModuleDeployer.java:217)
      3. org.springframework.xd.dirt.module.ModuleDeployer.deploy(ModuleDeployer.java:200)
      4. org.springframework.xd.dirt.server.DeploymentListener.deployModule(DeploymentListener.java:363)
      5. org.springframework.xd.dirt.server.DeploymentListener.deployStreamModule(DeploymentListener.java:332)
      6. org.springframework.xd.dirt.server.DeploymentListener.onChildAdded(DeploymentListener.java:179)
      7. org.springframework.xd.dirt.server.DeploymentListener.childEvent(DeploymentListener.java:147)
      7 frames
    8. Fabric8
      PathChildrenCache$5.apply
      1. org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:509)
      2. org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:503)
      2 frames
    9. Curator Framework
      ListenerContainer$1.run
      1. org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:92)
      1 frame
    10. Guava
      MoreExecutors$SameThreadExecutorService.execute
      1. com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
      1 frame
    11. Curator Framework
      ListenerContainer.forEach
      1. org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:83)
      1 frame
    12. Fabric8
      PathChildrenCache$10.run
      1. org.apache.curator.framework.recipes.cache.PathChildrenCache.callListeners(PathChildrenCache.java:500)
      2. org.apache.curator.framework.recipes.cache.EventOperation.invoke(EventOperation.java:35)
      3. org.apache.curator.framework.recipes.cache.PathChildrenCache$10.run(PathChildrenCache.java:762)
      3 frames
    13. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      2. java.util.concurrent.FutureTask.run(FutureTask.java:262)
      3. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      4. java.util.concurrent.FutureTask.run(FutureTask.java:262)
      5. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      6. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      7. java.lang.Thread.run(Thread.java:745)
      7 frames