java.lang.IllegalArgumentException: File must exist

GitHub | cmitchell | 2 months 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)[spring-boot-loader-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      2. org.springframework.boot.loader.data.RandomAccessDataFile.<init>(RandomAccessDataFile.java:51)[spring-boot-loader-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      3. org.springframework.boot.loader.jar.JarFile.<init>(JarFile.java:83)[spring-boot-loader-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      4. org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:61)[spring-boot-loader-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      5. org.springframework.boot.loader.archive.JarFileArchive.<init>(JarFileArchive.java:57)[spring-boot-loader-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      5 frames
    3. org.springframework.cloud
      StreamDeploymentController.deploy
      1. org.springframework.cloud.dataflow.configuration.metadata.ApplicationConfigurationMetadataResolver.listProperties(ApplicationConfigurationMetadataResolver.java:151)[spring-cloud-dataflow-configuration-metadata-1.0.1.RELEASE.jar:1.0.1.RELEASE]
      2. org.springframework.cloud.dataflow.server.controller.StreamDeploymentController.qualifyProperties(StreamDeploymentController.java:269)[spring-cloud-dataflow-server-core-1.0.1.RELEASE.jar:1.0.1.RELEASE]
      3. org.springframework.cloud.dataflow.server.controller.StreamDeploymentController.qualifyProperties(StreamDeploymentController.java:308)[spring-cloud-dataflow-server-core-1.0.1.RELEASE.jar:1.0.1.RELEASE]
      4. org.springframework.cloud.dataflow.server.controller.StreamDeploymentController.deployStream(StreamDeploymentController.java:246)[spring-cloud-dataflow-server-core-1.0.1.RELEASE.jar:1.0.1.RELEASE]
      5. org.springframework.cloud.dataflow.server.controller.StreamDeploymentController.deploy(StreamDeploymentController.java:186)[spring-cloud-dataflow-server-core-1.0.1.RELEASE.jar:1.0.1.RELEASE]
      5 frames
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_91]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_91]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_91]
      4. java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_91]
      4 frames
    5. Spring
      InvocableHandlerMethod.invokeForRequest
      1. org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2 frames
    6. Spring MVC
      FrameworkServlet.doPost
      1. org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:114)[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      3. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      4. org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      5. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      6. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      7. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      8. org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      8 frames
    7. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:648)[tomcat-embed-core-8.5.5.jar:8.5.5]
      1 frame
    8. Spring MVC
      FrameworkServlet.service
      1. org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)[spring-webmvc-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      1 frame
    9. JavaServlet
      HttpServlet.service
      1. javax.servlet.http.HttpServlet.service(HttpServlet.java:729)[tomcat-embed-core-8.5.5.jar:8.5.5]
      1 frame
    10. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2 frames
    11. Tomcat WS
      WsFilter.doFilter
      1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)[tomcat-embed-websocket-8.5.5.jar:8.5.5]
      1 frame
    12. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2 frames
    13. org.springframework.boot
      ApplicationContextHeaderFilter.doFilterInternal
      1. org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      1 frame
    14. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      1 frame
    15. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2 frames
    16. Spring Boot Actuator
      WebRequestTraceFilter.doFilterInternal
      1. org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:105)[spring-boot-actuator-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      1 frame
    17. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      1 frame
    18. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2 frames
    19. Spring Security
      FilterChainProxy.doFilter
      1. org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:208)[spring-security-web-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      2. org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)[spring-security-web-4.1.3.RELEASE.jar:4.1.3.RELEASE]
      2 frames
    20. Spring
      DelegatingFilterProxy.doFilter
      1. org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2 frames
    21. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2 frames
    22. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2 frames
    23. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2 frames
    24. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:89)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2 frames
    25. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2 frames
    26. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2 frames
    27. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2 frames
    28. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      2 frames
    29. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2 frames
    30. Spring Boot Actuator
      MetricsFilter.doFilterInternal
      1. org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:107)[spring-boot-actuator-1.4.1.RELEASE.jar:1.4.1.RELEASE]
      1 frame
    31. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
      1 frame
    32. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)[tomcat-embed-core-8.5.5.jar:8.5.5]
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)[tomcat-embed-core-8.5.5.jar:8.5.5]
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)[tomcat-embed-core-8.5.5.jar:8.5.5]
      5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)[tomcat-embed-core-8.5.5.jar:8.5.5]
      6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)[tomcat-embed-core-8.5.5.jar:8.5.5]
      7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)[tomcat-embed-core-8.5.5.jar:8.5.5]
      8. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)[tomcat-embed-core-8.5.5.jar:8.5.5]
      9. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)[tomcat-embed-core-8.5.5.jar:8.5.5]
      9 frames
    33. Grizzly HTTP
      SocketProcessorBase.run
      1. org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)[tomcat-embed-core-8.5.5.jar:8.5.5]
      2. org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)[tomcat-embed-core-8.5.5.jar:8.5.5]
      3. org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)[tomcat-embed-core-8.5.5.jar:8.5.5]
      4. org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1410)[tomcat-embed-core-8.5.5.jar:8.5.5]
      5. org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)[tomcat-embed-core-8.5.5.jar:8.5.5]
      5 frames
    34. Java RT
      ThreadPoolExecutor$Worker.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_91]
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_91]
      2 frames
    35. Tomcat Util
      TaskThread$WrappingRunnable.run
      1. org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)[tomcat-embed-core-8.5.5.jar:8.5.5]
      1 frame
    36. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)[na:1.8.0_91]
      1 frame