Uploaded image for project: 'Spring XD'
  1. Spring XD
  2. XD-2856

deploy-working-dir is set to to root directory when container is started as service

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1 GA
    • Fix Version/s: None
    • Component/s: Runtime
    • Labels:
      None
    • Story Points:
      1
    • Rank (Obsolete):
      9223372036854775807

      Description

      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:

      [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)
      

      deploy-working-dir should be set to a directory which writable by spring-xd user (maybe java.io.tmpdir?).

        Attachments

          Activity

            People

            Assignee:
            dturanski David Turanski
            Reporter:
            kdowbecki Karol Dowbecki
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: