java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist

Spring JIRA | Andy Wilkinson | 8 years ago
  1. 0

    I tried to deploy the greenpages 1.0.0 version of sample on the 2.0.0.CI-R225-B178 build of dm Server by providing the spring framework 2.5.6.A bundles to the repository. Not able to deploy and getting the below exception. [2009-05-11 09:27:40.857] server-dm-2 <SPDE0020E> Application context creation failure for bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.jpa'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more [2009-05-11 09:27:40.861] server-dm-2 <SPDE0020E> Application context creation failure for bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.jpa'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more [2009-05-11 09:27:41.363] server-dm-7 <SPDE0020E> Application context creation failure for bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.web'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more [2009-05-11 09:27:41.366] async-delivery-thread-1 <SPWE1000E> Failed to create web application '/greenpages': the associated web bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.web' failed to publish its ApplicationContext. [2009-05-11 09:27:41.367] fs-watcher <SPDE0027E> Exception deploying module 'file [/Users/rmadala/Documents/Builds/sprint3/springsource-dm-server-2.0.0.CI-R225-B178/work/com.springsource.kernel/Module/greenpages-1.0.0.SNAPSHOT/com.springsource.dmserver.greenpages.jpa-solution-1.0.0.SNAPSHOT.jar]'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more [2009-05-11 09:27:41.375] server-dm-7 <SPDE0020E> Application context creation failure for bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.web'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more

    SpringSource Issue Tracker | 8 years ago | Radhika Madala (c)
    java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist
  2. 0

    This problem is similar to http://jira.springframework.org/browse/SPR-5655, although it's a little more subtle and complex. Currently, dm Server's GreenPages sample application fails to deploy with the following exception: java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more The application context contains a GenericBeanDefinition that references org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter as a String, i.e. the class hasn't been loaded and, therefore, hasBeanClass returns false. This causes the code to use ASM to determine the presence, or otherwise, of @Configuration annotated. The bundle that contains this application context (the GreenPages Web bundle) contains an import for org.springframework.mvc.annotation as the application references types from that package. This means that the MetadataReader can load org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter and check for annotations. Although the MetadataReader is configuration with the classloader for the GreenPages Web bundle, this classloader delegates the load to the bundle that satisfied its import of org.springframework.web.servlet.mvc.annotation, i.e. the classloader for the org.springframework.web.servlet bundle is used. The while loop then proceeds up the inheritance hierarchy. This is where the problem occurs. AnnotationMethodHandlerAdapter extends org.springframework.web.servlet.support.WebContentGenerator. so the MetadataReader attempts to read WebContentGenerator. It uses the GreenPages web bundle's classloader to do so. This classloader cannot see WebContentGenerator as the bundle doesn't import WebContentGenerator and nor should it as it doesn't reference any types in this package. This results in the FileNotFoundException above. I believe that the solution here is to change the classloader that's used to read the metadata as the loop walks up the inheritance hierarchy: in an OSGi environment it's not safe to assume that a single classloader will be able to see all of the types in the hierarchy but it is safe to assume that the classloader at any point in the hierarchy will be able to see its super class. One potential problem may be that, to figure out the classloader that can actually see a type when OSGi-style delegation occurs, it would be necessary to actually load the class and then call getClassLoader on it which somewhat defeats the purpose of using ASM in the first place.

    Spring JIRA | 8 years ago | Andy Wilkinson
    java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist
  3. 0

    I tried to deploy the greenpages 1.0.0 version of sample on the 2.0.0.CI-R225-B178 build of dm Server by providing the spring framework 2.5.6.A bundles to the repository. Not able to deploy and getting the below exception. [2009-05-11 09:27:40.857] server-dm-2 <SPDE0020E> Application context creation failure for bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.jpa'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more [2009-05-11 09:27:40.861] server-dm-2 <SPDE0020E> Application context creation failure for bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.jpa'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more [2009-05-11 09:27:41.363] server-dm-7 <SPDE0020E> Application context creation failure for bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.web'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more [2009-05-11 09:27:41.366] async-delivery-thread-1 <SPWE1000E> Failed to create web application '/greenpages': the associated web bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.web' failed to publish its ApplicationContext. [2009-05-11 09:27:41.367] fs-watcher <SPDE0027E> Exception deploying module 'file [/Users/rmadala/Documents/Builds/sprint3/springsource-dm-server-2.0.0.CI-R225-B178/work/com.springsource.kernel/Module/greenpages-1.0.0.SNAPSHOT/com.springsource.dmserver.greenpages.jpa-solution-1.0.0.SNAPSHOT.jar]'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/transaction/support/AbstractPlatformTransactionManager.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more [2009-05-11 09:27:41.375] server-dm-7 <SPDE0020E> Application context creation failure for bundle 'greenpages-1.0.0.SNAPSHOT-greenpages.web'. java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more

    SpringSource Issue Tracker | 8 years ago | Radhika Madala (c)
    java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    This problem is similar to http://jira.springframework.org/browse/SPR-5655, although it's a little more subtle and complex. Currently, dm Server's GreenPages sample application fails to deploy with the following exception: java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:208) at org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127) at org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281) at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222) at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175) at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175) at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718) at com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:637) Caused by: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69) at org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199) ... 17 more The application context contains a GenericBeanDefinition that references org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter as a String, i.e. the class hasn't been loaded and, therefore, hasBeanClass returns false. This causes the code to use ASM to determine the presence, or otherwise, of @Configuration annotated. The bundle that contains this application context (the GreenPages Web bundle) contains an import for org.springframework.mvc.annotation as the application references types from that package. This means that the MetadataReader can load org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter and check for annotations. Although the MetadataReader is configuration with the classloader for the GreenPages Web bundle, this classloader delegates the load to the bundle that satisfied its import of org.springframework.web.servlet.mvc.annotation, i.e. the classloader for the org.springframework.web.servlet bundle is used. The while loop then proceeds up the inheritance hierarchy. This is where the problem occurs. AnnotationMethodHandlerAdapter extends org.springframework.web.servlet.support.WebContentGenerator. so the MetadataReader attempts to read WebContentGenerator. It uses the GreenPages web bundle's classloader to do so. This classloader cannot see WebContentGenerator as the bundle doesn't import WebContentGenerator and nor should it as it doesn't reference any types in this package. This results in the FileNotFoundException above. I believe that the solution here is to change the classloader that's used to read the metadata as the loop walks up the inheritance hierarchy: in an OSGi environment it's not safe to assume that a single classloader will be able to see all of the types in the hierarchy but it is safe to assume that the classloader at any point in the hierarchy will be able to see its super class. One potential problem may be that, to figure out the classloader that can actually see a type when OSGi-style delegation occurs, it would be necessary to actually load the class and then call getClassLoader on it which somewhat defeats the purpose of using ASM in the first place.

    Spring JIRA | 8 years ago | Andy Wilkinson
    java.lang.RuntimeException: java.io.FileNotFoundException: class path resource [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist
  6. 0

    Handle the use of @ComponentScan in the default package more gracefully

    GitHub | 2 years ago | wilkinsona
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [Application]; nested exception is java.io.FileNotFoundException: class path resource [org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.class] cannot be opened because it does not exist
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 [org/springframework/web/servlet/support/WebContentGenerator.class] cannot be opened because it does not exist

    at org.springframework.core.io.ClassPathResource.getInputStream()
  2. Spring Core
    SimpleMetadataReaderFactory.getMetadataReader
    1. org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:143)
    2. org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:73)
    3. org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:69)
    3 frames
  3. Spring Context
    ConfigurationClassPostProcessor.postProcessBeanFactory
    1. org.springframework.context.annotation.ConfigurationClassPostProcessor.isConfigurationClassBeanDefinition(ConfigurationClassPostProcessor.java:199)
    2. org.springframework.context.annotation.ConfigurationClassPostProcessor.getConfigurationBeanDefinitions(ConfigurationClassPostProcessor.java:127)
    3. org.springframework.context.annotation.AbstractConfigurationClassProcessor.processConfigBeanDefinitions(AbstractConfigurationClassProcessor.java:98)
    4. org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:95)
    4 frames
  4. Spring OSGi Core
    AbstractDelegatedExecutionApplicationContext.startRefresh
    1. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:479)
    2. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:459)
    3. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:395)
    4. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:281)
    5. org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
    6. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)
    6 frames
  5. org.springframework.osgi
    DependencyWaiterApplicationContextExecutor.refresh
    1. org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:222)
    2. org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:175)
    2 frames
  6. Spring OSGi Core
    AbstractDelegatedExecutionApplicationContext.refresh
    1. org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
    1 frame
  7. org.springframework.osgi
    ContextLoaderListener$2.run
    1. org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)
    1 frame
  8. com.springsource.kernel
    ContextPropagatingTaskExecutor$2.run
    1. com.springsource.kernel.dmfragment.internal.ContextPropagatingTaskExecutor$2.run(ContextPropagatingTaskExecutor.java:82)
    1 frame
  9. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    3. java.lang.Thread.run(Thread.java:637)
    3 frames