Project: springxd
Issue XD-2820: Composing transformer and gemfire-json-server leads to FileNotFoundException during deployment
Composing "transform" and "gemfire-json-server" modules leads to FileNotFoundException during stream deployment when: - xd-admin and xd-container are started as system services (after installing from RPM). - xd-singelonde is started outside of $XD_HOME/bin directory e.g. {code} $ cd "$XD_HOME" $ bin/xd-singelonde {code} but it's fully working and exception is *not* thrown when: - xd-singlenode script is started from within "$XD_HOME/bin directory {code} $ cd "$XD_HOME/bin" $ ./xd-singelonde {code} Then using the XD Shell: {code} $ xd-shell > module compose --name "cm-gem-sink" --definition "transform --outputType='application/json' | gemfire-json-server --regionName=timeRegion --keyExpression=payload.getField('location')" > stream create --name "cm-test-gem" --definition "tail --name='/tmp/time.json' | cm-gem-sink" > stream deploy --name "cm-test-gem" {code} Stream deployment will result in following exception {code} [2015-03-11 16:38:10.918] boot - 17402 INFO [DeploymentsPathChildrenCache-0] --- DeploymentListener: Deploying module [ModuleDescriptor@2095e9f9 moduleName = 'tail', moduleLabel = 'tail', group = 'cm-test-gem', sourceChannelName = [null], sinkChannelName = [null], index = 0, type = source, parameters = map['name' -> '/tmp/time.json'], children = list[[empty]]] 2015-03-11 16:38:11,263 1.1.0.RELEASE INFO DeploymentSupervisor-0 server.StreamDeploymentListener - Deployment status for stream 'cm-test-gem': DeploymentStatus{state=failed,error(s)=org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Error evaluating Groovy script: Configuration problem: Error evaluating Groovy script: ../modules/common/gemfire-sink.groovy (No such file or directory) Offending resource: URL [file:../modules/common/gemfire-sink.groovy]; nested exception is java.io.FileNotFoundException: ../modules/common/gemfire-sink.groovy (No such file or directory) Offending resource: file [/opt/spring-xd/spring-xd-1.1.0.RELEASE/xd/modules/sink/gemfire-json-server/config/gemfire-json-server.groovy]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Error evaluating Groovy script: ../modules/common/gemfire-sink.groovy (No such file or directory) Offending resource: URL [file:../modules/common/gemfire-sink.groovy]; nested exception is java.io.FileNotFoundException: ../modules/common/gemfire-sink.groovy (No such file or directory) org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:247) org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:202) org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:178) org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:138) org.springframework.boot.BeanDefinitionLoader.load(BeanDefinitionLoader.java:127) org.springframework.boot.SpringApplication.load(SpringApplication.java:620) org.springframework.boot.SpringApplication.run(SpringApplication.java:315) org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139) org.springframework.xd.module.core.SimpleModule.initialize(SimpleModule.java:214) org.springframework.xd.module.core.CompositeModule.initialize(CompositeModule.java:105) org.springframework.xd.dirt.module.ModuleDeployer.doDeploy(ModuleDeployer.java:217) org.springframework.xd.dirt.module.ModuleDeployer.deploy(ModuleDeployer.java:200) org.springframework.xd.dirt.server.DeploymentListener.deployModule(DeploymentListener.java:363) org.springframework.xd.dirt.server.DeploymentListener.deployStreamModule(DeploymentListener.java:332) org.springframework.xd.dirt.server.DeploymentListener.onChildAdded(DeploymentListener.java:179) org.springframework.xd.dirt.server.DeploymentListener.childEvent(DeploymentListener.java:147) org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:509) org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:503) org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:92) com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297) org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:83) org.apache.curator.framework.recipes.cache.PathChildrenCache.callListeners(PathChildrenCache.java:500) org.apache.curator.framework.recipes.cache.EventOperation.invoke(EventOperation.java:35) org.apache.curator.framework.recipes.cache.PathChildrenCache$10.run(PathChildrenCache.java:762) java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) java.util.concurrent.FutureTask.run(FutureTask.java:262) java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) java.util.concurrent.FutureTask.run(FutureTask.java:262) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Error evaluating Groovy script: ../modules/common/gemfire-sink.groovy (No such file or directory) Offending resource: URL [file:../modules/common/gemfire-sink.groovy]; nested exception is java.io.FileNotFoundException: ../modules/common/gemfire-sink.groovy (No such file or directory) org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:247) org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:202) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188) org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.importBeans(GroovyBeanDefinitionReader.java:337) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:368) groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016) org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) beans$_run_closure1.doCall(beans:4) beans$_run_closure1.doCall(beans) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:278) groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016) groovy.lang.Closure.call(Closure.java:423) groovy.lang.Closure.call(Closure.java:417) org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.invokeBeanDefiningClosure(GroovyBeanDefinitionReader.java:426) org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader$1.call(GroovyBeanDefinitionReader.java:223) groovy.lang.Closure.call(Closure.java:439) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207) groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016) groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1253) groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209) groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016) org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) beans.run(beans:1) groovy.lang.GroovyShell.evaluate(GroovyShell.java:649) org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:243)	... 30 more Caused by: java.io.FileNotFoundException: ../modules/common/gemfire-sink.groovy (No such file or directory) java.io.FileInputStream.open(Native Method) java.io.FileInputStream.(FileInputStream.java:146) java.io.FileInputStream.(FileInputStream.java:101) sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) org.springframework.core.io.UrlResource.getInputStream(UrlResource.java:168) org.springframework.core.io.support.EncodedResource.getReader(EncodedResource.java:132) org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.loadBeanDefinitions(GroovyBeanDefinitionReader.java:243)	... 80 more {code} Exporting XD_HOME as a global variable seems to have no effect on this behavior.
Story points: 2