org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [org.springframework.issues.DogService]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/issues/DogService$Wuffing$1.class] cannot be opened because it does not exist

Spring JIRA | Tadas Krivickas | 1 year ago
  1. 0

    {code:java} org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [org.springframework.issues.DogService]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/issues/DogService$Wuffing$1.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:179) ... Caused by: java.io.FileNotFoundException: class path resource [org/springframework/issues/DogService$Wuffing$1.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172) at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:50) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:98) at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:93) at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:596) at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getMemberClasses(ConfigurationClassParser.java:758) at org.springframework.context.annotation.ConfigurationClassParser.processMemberClasses(ConfigurationClassParser.java:314) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:246) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:229) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:196) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:165) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:306) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:103) at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68) at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86) at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212) at org.spockframework.spring.SpringTestContextManager.prepareTestInstance(SpringTestContextManager.java:49) at org.spockframework.spring.SpringInterceptor.interceptSetupMethod(SpringInterceptor.java:42) at org.spockframework.runtime.extension.AbstractMethodInterceptor.intercept(AbstractMethodInterceptor.java:28) at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:87) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) {code} I've observed that this can be fixed in two ways: # Moving the interface outside of class to package # Replacing {{@Component}} with {{@javax.inject.Named}} Other notes: - Does not occur in an analogous situation using java, by implementing a private nested interface via lambda expression. Pull request to reproduce: https://github.com/spring-projects/spring-framework-issues/pull/98

    Spring JIRA | 1 year ago | Tadas Krivickas
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [org.springframework.issues.DogService]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/issues/DogService$Wuffing$1.class] cannot be opened because it does not exist
  2. 0

    {code:java} org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [org.springframework.issues.DogService]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/issues/DogService$Wuffing$1.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:179) ... Caused by: java.io.FileNotFoundException: class path resource [org/springframework/issues/DogService$Wuffing$1.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172) at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:50) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:98) at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:93) at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:596) at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getMemberClasses(ConfigurationClassParser.java:758) at org.springframework.context.annotation.ConfigurationClassParser.processMemberClasses(ConfigurationClassParser.java:314) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:246) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:229) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:196) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:165) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:306) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:239) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:254) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:606) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:462) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.test.SpringApplicationContextLoader.loadContext(SpringApplicationContextLoader.java:103) at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:68) at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:86) at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:72) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212) at org.spockframework.spring.SpringTestContextManager.prepareTestInstance(SpringTestContextManager.java:49) at org.spockframework.spring.SpringInterceptor.interceptSetupMethod(SpringInterceptor.java:42) at org.spockframework.runtime.extension.AbstractMethodInterceptor.intercept(AbstractMethodInterceptor.java:28) at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:87) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) {code} I've observed that this can be fixed in two ways: # Moving the interface outside of class to package # Replacing {{@Component}} with {{@javax.inject.Named}} Other notes: - Does not occur in an analogous situation using java, by implementing a private nested interface via lambda expression. Pull request to reproduce: https://github.com/spring-projects/spring-framework-issues/pull/98

    Spring JIRA | 1 year ago | Tadas Krivickas
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [org.springframework.issues.DogService]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/issues/DogService$Wuffing$1.class] cannot be opened because it does not exist
  3. 0

    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class

    Stack Overflow | 2 years ago | user672009
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: dk.fitfit.hunger.config.Application; nested exception is
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring Batch+Boot and: [org/springframework/web/WebApplicationInitializer.class] cannot be opened because it does not exist

    Stack Overflow | 2 years ago
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to load bean class: ; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/web/WebApplicationInitializer.class] cannot be opened because it does not exist
  6. 0

    spring-boot application.properties maven multi-module setup

    Stack Overflow | 1 year ago | bilak
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.github.bilak.axonframework.poc.Application]; nested exception is java.io.FileNotFoundException: class path resource [infrastructure.properties] cannot be opened because it does not exist

  1. fima 6 times, last 2 months ago
1 unregistered visitors
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. org.springframework.beans.factory.BeanDefinitionStoreException

    Failed to parse configuration class [org.springframework.issues.DogService]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/issues/DogService$Wuffing$1.class] cannot be opened because it does not exist

    at org.springframework.context.annotation.ConfigurationClassParser.parse()
  2. Spring Context
    ConfigurationClassParser.parse
    1. org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:179)
    1 frame