java.lang.IllegalArgumentException: File must exist

Spring JIRA | Ilayaperumal Gopinathan | 1 year ago
  1. 0

    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 at org.springframework.boot.loader.data.RandomAccessDataFile.<init>(RandomAccessDataFile.java:67) at org.springframework.boot.loader.data.RandomAccessDataFile.<init>(RandomAccessDataFile.java:51) at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:95) at org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:61) at org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:57) at org.springframework.xd.module.support.ModuleUtils.createModuleClassLoader(ModuleUtils.java:54) at org.springframework.xd.module.support.ModuleUtils.createModuleClassLoader(ModuleUtils.java:47) at org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolveNormalMetadata(DefaultModuleOptionsMetadataResolver.java:186) at org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolve(DefaultModuleOptionsMetadataResolver.java:164) at org.springframework.xd.module.options.DelegatingModuleOptionsMetadataResolver.resolve(DelegatingModuleOptionsMetadataResolver.java:44) at org.springframework.xd.module.options.EnvironmentAwareModuleOptionsMetadataResolver.resolve(EnvironmentAwareModuleOptionsMetadataResolver.java:127) at org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolveComposedModuleMetadata(DefaultModuleOptionsMetadataResolver.java:175) at org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolve(DefaultModuleOptionsMetadataResolver.java:167) at org.springframework.xd.module.options.DelegatingModuleOptionsMetadataResolver.resolve(DelegatingModuleOptionsMetadataResolver.java:44) at org.springframework.xd.module.options.EnvironmentAwareModuleOptionsMetadataResolver.resolve(EnvironmentAwareModuleOptionsMetadataResolver.java:127) at 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(); ```

    Spring JIRA | 1 year ago | Ilayaperumal Gopinathan
    java.lang.IllegalArgumentException: File must exist
  2. 0

    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 at org.springframework.boot.loader.data.RandomAccessDataFile.<init>(RandomAccessDataFile.java:67) at org.springframework.boot.loader.data.RandomAccessDataFile.<init>(RandomAccessDataFile.java:51) at org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:95) at org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:61) at org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:57) at org.springframework.xd.module.support.ModuleUtils.createModuleClassLoader(ModuleUtils.java:54) at org.springframework.xd.module.support.ModuleUtils.createModuleClassLoader(ModuleUtils.java:47) at org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolveNormalMetadata(DefaultModuleOptionsMetadataResolver.java:186) at org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolve(DefaultModuleOptionsMetadataResolver.java:164) at org.springframework.xd.module.options.DelegatingModuleOptionsMetadataResolver.resolve(DelegatingModuleOptionsMetadataResolver.java:44) at org.springframework.xd.module.options.EnvironmentAwareModuleOptionsMetadataResolver.resolve(EnvironmentAwareModuleOptionsMetadataResolver.java:127) at org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolveComposedModuleMetadata(DefaultModuleOptionsMetadataResolver.java:175) at org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolve(DefaultModuleOptionsMetadataResolver.java:167) at org.springframework.xd.module.options.DelegatingModuleOptionsMetadataResolver.resolve(DelegatingModuleOptionsMetadataResolver.java:44) at org.springframework.xd.module.options.EnvironmentAwareModuleOptionsMetadataResolver.resolve(EnvironmentAwareModuleOptionsMetadataResolver.java:127) at 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(); ```

    Spring JIRA | 1 year ago | Ilayaperumal Gopinathan
    java.lang.IllegalArgumentException: File must exist
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Does wildcard pattern supported in loader.path for spring boot application

    Stack Overflow | 1 year ago | pratim_b
    java.lang.IllegalArgumentException: File must exist
  5. 0

    Having issue with running my csv file in my jmeter

    Stack Overflow | 3 months ago | user6775682
    java.lang.IllegalArgumentException: File NewOffenderInfo must exist and be readable

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      File must exist

      at org.springframework.boot.loader.data.RandomAccessDataFile.<init>()
    2. Spring Boot Loader
      JarFileArchive.<init>
      1. org.springframework.boot.loader.data.RandomAccessDataFile.<init>(RandomAccessDataFile.java:67)
      2. org.springframework.boot.loader.data.RandomAccessDataFile.<init>(RandomAccessDataFile.java:51)
      3. org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:95)
      4. org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:61)
      5. org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:57)
      5 frames
    3. org.springframework.xd
      XDStreamParser.parse
      1. org.springframework.xd.module.support.ModuleUtils.createModuleClassLoader(ModuleUtils.java:54)
      2. org.springframework.xd.module.support.ModuleUtils.createModuleClassLoader(ModuleUtils.java:47)
      3. org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolveNormalMetadata(DefaultModuleOptionsMetadataResolver.java:186)
      4. org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolve(DefaultModuleOptionsMetadataResolver.java:164)
      5. org.springframework.xd.module.options.DelegatingModuleOptionsMetadataResolver.resolve(DelegatingModuleOptionsMetadataResolver.java:44)
      6. org.springframework.xd.module.options.EnvironmentAwareModuleOptionsMetadataResolver.resolve(EnvironmentAwareModuleOptionsMetadataResolver.java:127)
      7. org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolveComposedModuleMetadata(DefaultModuleOptionsMetadataResolver.java:175)
      8. org.springframework.xd.module.options.DefaultModuleOptionsMetadataResolver.resolve(DefaultModuleOptionsMetadataResolver.java:167)
      9. org.springframework.xd.module.options.DelegatingModuleOptionsMetadataResolver.resolve(DelegatingModuleOptionsMetadataResolver.java:44)
      10. org.springframework.xd.module.options.EnvironmentAwareModuleOptionsMetadataResolver.resolve(EnvironmentAwareModuleOptionsMetadataResolver.java:127)
      11. org.springframework.xd.dirt.stream.XDStreamParser.parse(XDStreamParser.java:174)
      11 frames