Pattern selector

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

  1. StandardContext.start() has thrown a BeanInitializationException
    Tomcat Catalina
    0
    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 [cas.properties] cannot be opened because it does not exist
    at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)
    at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:182)
    at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:161)
    at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:69)

Solution

chinthana11 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. liyanxivia GitHub3 weeks ago
    IOException parsing XML document from class path resource [spring-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring-context.xml] cannot be opened because it does not exist
    Show stack trace
  2. Unknown authorvia Google Groups1 month 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
  3. MysticRyuujinvia GitHub1 month 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
  4. solidersvia GitHub2 months 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
  5. JiangChen123via GitHub3 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
  6. monstervia Stack Overflow3 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
  7. 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
  8. 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
  9. narsivia Stack Overflow3 months ago
    class path resource [einvoice-spring.properties] cannot be opened because it does not exist
    Show stack trace
  10. ericsawlervia GitHub4 months ago
    class path resource [gs://ericstest/my-file.txt] cannot be opened because it does not exist
    Show stack trace