Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. LifecycleBase.start() has thrown a BeanInitializationException
    Tomcat Catalina
    1
    0
    0
  2. ClassPathResource.getInputStream() has thrown a FileNotFoundException
    Spring Core
    169
    39
    30

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
java.io.FileNotFoundException: class path resource [WEB-INF/config/redis.properties] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
    at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:153)
    at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:98)
    at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:175)
2 frames hidden

Solution

chinthana10 months ago

Use this method to gain access to the ApplicationContext:

@Autowired
private ApplicationContext applicationContext;

Check the source of this solution for more info

External results for this pattern (10)

  1. Unknown authorvia Google Groups1 week ago
    IOException parsing XML document from class path resource [spring/match-converter-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/match-converter-context.xml] cannot be opened because it does not exist
    Show stack trace
  2. MysticRyuujinvia GitHub1 week ago
    Failed to parse configuration class [com.ethercamp.harmony.Application]; nested exception is java.io.FileNotFoundException: class path resource [org/ethereum/vm/VMHook.class] cannot be opened because it does not exist
    Show stack trace
  3. solidersvia GitHub1 month ago
    IOException parsing XML document from class path resource [activiti.cfg.xml]; nested exception is java.io.FileNotFoundException: class path resource [activiti.cfg.xml] cannot be opened because it does not exist
    Show stack trace
  4. JiangChen123via GitHub2 months ago
    IOException parsing XML document from class path resource [ureport-core-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [ureport-core-context.xml] cannot be opened because it does not exist
    Show stack trace
  5. monstervia Stack Overflow2 months ago
    Failed to parse configuration class [Application]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/session/data/mongo/config/annotation/web/reactive/ReactiveMongoWebSessionConfiguration.class] cannot be opened because it does not exist
    Show stack trace
  6. Failed to parse configuration class [com.sankuai.xy.safelog.SafelogApplication]; nested exception is java.io.FileNotFoundException: class path resource [org/apache/ibatis/plugin/Interceptor.class] cannot be opened because it does not exist
    Show stack trace
  7. Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [datasource.properties] cannot be opened because it does not exist
    Show stack trace
  8. narsivia Stack Overflow2 months ago
    class path resource [einvoice-spring.properties] cannot be opened because it does not exist
    Show stack trace
  9. ericsawlervia GitHub3 months ago
    class path resource [gs://ericstest/my-file.txt] cannot be opened because it does not exist
    Show stack trace
  10. IOException parsing XML document from class path resource [spring.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring.xml] cannot be opened because it does not exist
    Show stack trace