org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filesOut.adapter': Cannot resolve reference to bean 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unexpected IOException when looking for destination directory: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output]

Spring JIRA | Joe Witt | 7 years ago
  1. 0

    When attempting to run the filecopy samples (bytecopy) for example was routinely receiving error about unable to resolve URI when using the as released configuration. The failure makes sense since this directory does not yet exist. If the tool won't make them for you then perhaps some instructions indicating that it needs to be created would be helpful. Or, better yet, since this is in temporary space appropriate for the running user perhaps auto create the dirs. It cannot be done in the FileCopyDemoCommon.displayDirectories() call as is because the app context is built before that is called. If the FileCopyDemoCommon.displayDirectories() is called before constructing the context and that method is updated to auto create the dirs then it should be good. There is a related problem that is the FileCopyDemoCommon.displayDirectories() class displays paths which are not at all associated with the context configuration. If a user tries different context configurations then the FileCopyDemoCommon impl as it is won't be too helpful. Also, FileCopyDemoCommon constructs a URL using the Path.seperator when using the built-in constructor of File(File,string) would probably be more 'pure Java'. Full Stack Trace From byte copy sample run... --------------------------------------------------------- Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filesOut.adapter': Cannot resolve reference to bean 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unexpected IOException when looking for destination directory: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:308) at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:947) at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:701) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:377) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:197) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:172) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158) at org.springframework.integration.samples.filecopy.BinaryFileCopyDemo.main(BinaryFileCopyDemo.java:33) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unexpected IOException when looking for destination directory: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output] at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:127) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:91) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1288) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:275) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269) ... 20 more Caused by: java.lang.IllegalArgumentException: Unexpected IOException when looking for destination directory: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output] at org.springframework.integration.file.FileWritingMessageHandler.<init>(FileWritingMessageHandler.java:91) at org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean.initHandler(FileWritingMessageHandlerFactoryBean.java:142) at org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean.getObject(FileWritingMessageHandlerFactoryBean.java:122) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:121) ... 28 more Caused by: java.io.FileNotFoundException: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output] cannot be resolved to URL because it does not exist at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:163) at org.springframework.core.io.ClassPathResource.getFile(ClassPathResource.java:175) at org.springframework.integration.file.FileWritingMessageHandler.<init>(FileWritingMessageHandler.java:83) ... 31 more

    Spring JIRA | 7 years ago | Joe Witt
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filesOut.adapter': Cannot resolve reference to bean 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unexpected IOException when looking for destination directory: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output]
  2. 0

    When attempting to run the filecopy samples (bytecopy) for example was routinely receiving error about unable to resolve URI when using the as released configuration. The failure makes sense since this directory does not yet exist. If the tool won't make them for you then perhaps some instructions indicating that it needs to be created would be helpful. Or, better yet, since this is in temporary space appropriate for the running user perhaps auto create the dirs. It cannot be done in the FileCopyDemoCommon.displayDirectories() call as is because the app context is built before that is called. If the FileCopyDemoCommon.displayDirectories() is called before constructing the context and that method is updated to auto create the dirs then it should be good. There is a related problem that is the FileCopyDemoCommon.displayDirectories() class displays paths which are not at all associated with the context configuration. If a user tries different context configurations then the FileCopyDemoCommon impl as it is won't be too helpful. Also, FileCopyDemoCommon constructs a URL using the Path.seperator when using the built-in constructor of File(File,string) would probably be more 'pure Java'. Full Stack Trace From byte copy sample run... --------------------------------------------------------- Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filesOut.adapter': Cannot resolve reference to bean 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unexpected IOException when looking for destination directory: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:308) at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:947) at org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:701) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:377) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:197) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:172) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158) at org.springframework.integration.samples.filecopy.BinaryFileCopyDemo.main(BinaryFileCopyDemo.java:33) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unexpected IOException when looking for destination directory: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output] at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:127) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:91) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1288) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:275) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269) ... 20 more Caused by: java.lang.IllegalArgumentException: Unexpected IOException when looking for destination directory: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output] at org.springframework.integration.file.FileWritingMessageHandler.<init>(FileWritingMessageHandler.java:91) at org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean.initHandler(FileWritingMessageHandlerFactoryBean.java:142) at org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean.getObject(FileWritingMessageHandlerFactoryBean.java:122) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:121) ... 28 more Caused by: java.io.FileNotFoundException: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output] cannot be resolved to URL because it does not exist at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:163) at org.springframework.core.io.ClassPathResource.getFile(ClassPathResource.java:175) at org.springframework.integration.file.FileWritingMessageHandler.<init>(FileWritingMessageHandler.java:83) ... 31 more

    Spring JIRA | 7 years ago | Joe Witt
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filesOut.adapter': Cannot resolve reference to bean 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0' while setting bean property 'handler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean#0': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalArgumentException: Unexpected IOException when looking for destination directory: class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output]
  3. 0

    Struts 2 - Struts 2 testing with jUnit plugin

    nabble.com | 4 months ago
    java.io.FileNotFoundException: class path resource [WEB-INF/content/] cannot be resolved to URL because it does not exist
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [jira] [Resolved] (WW-4080) Annotations example fails

    apache.org | 1 year ago
    java.io.FileNotFoundException: class path resource [WEB-INF/content/] cannot be resolved to URL because it does not exist
  6. 0

    ClassPathResource.getFile() throws FileNotFoundException within WAR

    Stack Overflow | 6 years ago | Tapas Bose
    java.io.FileNotFoundException: class path resource [ems-init.properties] cannot be resolved to absolute file path because it does not reside in the file system: vfs:/home/tanmoy/JBoss/jboss-as-distribution-6.0.0.Final/server/default/deploy/EMS.war/WEB-INF/classes/ems-init.properties

    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.io.FileNotFoundException

      class path resource [C:/DOCUME~1/Joseph/LOCALS~1/Temp//spring-integration-samples/output] cannot be resolved to URL because it does not exist

      at org.springframework.core.io.ClassPathResource.getURL()
    2. Spring Core
      ClassPathResource.getFile
      1. org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:163)
      2. org.springframework.core.io.ClassPathResource.getFile(ClassPathResource.java:175)
      2 frames
    3. org.springframework.integration
      FileWritingMessageHandlerFactoryBean.getObject
      1. org.springframework.integration.file.FileWritingMessageHandler.<init>(FileWritingMessageHandler.java:83)
      2. org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean.initHandler(FileWritingMessageHandlerFactoryBean.java:142)
      3. org.springframework.integration.file.config.FileWritingMessageHandlerFactoryBean.getObject(FileWritingMessageHandlerFactoryBean.java:122)
      3 frames
    4. Spring Beans
      FactoryBeanRegistrySupport$1.run
      1. org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:121)
      1 frame
    5. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    6. Spring Beans
      AbstractAutowireCapableBeanFactory$1.run
      1. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116)
      2. org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:91)
      3. org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1288)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:275)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      7. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
      8. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
      9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
      10. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
      11. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
      12. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      12 frames
    7. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    8. Spring Beans
      DefaultListableBeanFactory.getBeansOfType
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      2. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
      3. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
      5. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      6. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      7. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:308)
      7 frames
    9. Spring Context
      ClassPathXmlApplicationContext.<init>
      1. org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:947)
      2. org.springframework.context.support.AbstractApplicationContext.registerListeners(AbstractApplicationContext.java:701)
      3. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:377)
      4. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:197)
      5. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:172)
      6. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158)
      6 frames
    10. org.springframework.integration
      BinaryFileCopyDemo.main
      1. org.springframework.integration.samples.filecopy.BinaryFileCopyDemo.main(BinaryFileCopyDemo.java:33)
      1 frame