Project: springxd
Issue XD-3171: Composed modules not working on YARN
From https://github.com/spring-projects/spring-xd/issues/1704 I am trying to use composed modules when running on YARN. In ZK, each child module definition of the composed module gets serialized as follows: ``` {"@class":"org.springframework.xd.module.SimpleModuleDefinition","name":"transform","type":"processor","location":"file:/tmp/hadoop-hduser/nm-local-dir/usercache/hduser/appcache/application_1433789137218_0001/filecache/17/spring-xd-yarn-1.1.2.RELEASE.zip/modules/processor/transform/"} ``` When I try to use the composed module on YARN, it may be deployed to a different container where the "location" file path is not valid. In this case I get the following exception: ``` java.lang.IllegalArgumentException: File must exist org.springframework.boot.loader.data.RandomAccessDataFile.(RandomAccessDataFile.java:67) org.springframework.boot.loader.data.RandomAccessDataFile.(RandomAccessDataFile.java:51) org.springframework.boot.loader.jar.JarFile.(JarFile.java:95) org.springframework.boot.loader.archive.JarFileArchive.(JarFileArchive.java:61) org.springframework.boot.loader.archive.JarFileArchive.(JarFileArchive.java:57) org.springframework.xd.module.support.ModuleUtils.createModuleClassLoader(ModuleUtils.java:54) org.springframework.xd.module.support.ModuleUtils.createModuleClassLoader(ModuleUtils.java:47) org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolveNormalMetadata(DefaultModuleOptionsMetadataResolver.java:186) org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolve(DefaultModuleOptionsMetadataResolver.java:164) org.springframework.xd.module.options.DelegatingModuleOptionsMetadataResolver.resolve(DelegatingModuleOptionsMetadataResolver.java:44) org.springframework.xd.module.options.EnvironmentAwareModuleOptionsMetadataResolver.resolve(EnvironmentAwareModuleOptionsMetadataResolver.java:127) org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolveComposedModuleMetadata(DefaultModuleOptionsMetadataResolver.java:175) org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolve(DefaultModuleOptionsMetadataResolver.java:167) org.springframework.xd.module.options.DelegatingModuleOptionsMetadataResolver.resolve(DelegatingModuleOptionsMetadataResolver.java:44) org.springframework.xd.module.options.EnvironmentAwareModuleOptionsMetadataResolver.resolve(EnvironmentAwareModuleOptionsMetadataResolver.java:127) org.springframework.xd.dirt.stream.XDStreamParser.parse(XDStreamParser.java:174) ``` I think the issue may be related to the following line in ArchiveModuleRegistry: ``` String filename = resource.getFile().getCanonicalFile().getName(); ```
Story points: 5