org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: C:\projects\StackWorkspace-2.1\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\stack-petstore\WEB-INF\classes\org\lds\stack\petstore\view\bean (Access is denied)

Spring JIRA | Mike Youngstrom | 9 years ago
  1. 0

    If I use component-scan with a resource-pattern like: <context:component-scan base-package="org.lds" resource-pattern="**/view/**" /> Then I get and Access Denied error. This appears to be caused by ClassPathScanningCandidateComponentProvider.findCandidateComponents attempting to open resources that are directories returned from resourcePatternResolver.getResources(). Perhaps before attempting to open the resource a check should be done to ensure that found resources are not a directories? As a workaround a resource-pattern that won't return directories works: <context:component-scan base-package="org.lds" resource-pattern="**/view/**/*.class" /> org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: C:\projects\StackWorkspace-2.1\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\stack-petstore\WEB-INF\classes\org\lds\stack\petstore\view\bean (Access is denied) at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:186) at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:192) at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:159) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1246) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1236) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:488) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:383) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:327) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:295) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.lds.stack.spring.context.SpringContextUtils.loadBeanDefinitions(SpringContextUtils.java:49) at org.lds.stack.spring.context.ResourceFilterableWebApplicationContext.loadBeanDefinitions(ResourceFilterableWebApplicationContext.java:27) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:97) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:411) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:338) at org.lds.stack.spring.context.BootstrapContextLoader.createWebApplicationContext(BootstrapContextLoader.java:34) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3025) at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:432) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1278) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559) at java.lang.Thread.run(Thread.java:595) Caused by: java.io.FileNotFoundException: C:\projects\StackWorkspace-2.1\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\stack-petstore\WEB-INF\classes\org\lds\stack\petstore\view\bean (Access is denied) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:85) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:74) at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:68) at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:175) ... 32 more

    Spring JIRA | 9 years ago | Mike Youngstrom
    org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: C:\projects\StackWorkspace-2.1\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\stack-petstore\WEB-INF\classes\org\lds\stack\petstore\view\bean (Access is denied)
  2. 0

    If I use component-scan with a resource-pattern like: <context:component-scan base-package="org.lds" resource-pattern="**/view/**" /> Then I get and Access Denied error. This appears to be caused by ClassPathScanningCandidateComponentProvider.findCandidateComponents attempting to open resources that are directories returned from resourcePatternResolver.getResources(). Perhaps before attempting to open the resource a check should be done to ensure that found resources are not a directories? As a workaround a resource-pattern that won't return directories works: <context:component-scan base-package="org.lds" resource-pattern="**/view/**/*.class" /> org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: C:\projects\StackWorkspace-2.1\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\stack-petstore\WEB-INF\classes\org\lds\stack\petstore\view\bean (Access is denied) at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:186) at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:192) at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:159) at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1246) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1236) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:488) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:383) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:327) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:295) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.lds.stack.spring.context.SpringContextUtils.loadBeanDefinitions(SpringContextUtils.java:49) at org.lds.stack.spring.context.ResourceFilterableWebApplicationContext.loadBeanDefinitions(ResourceFilterableWebApplicationContext.java:27) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:97) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:411) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:338) at org.lds.stack.spring.context.BootstrapContextLoader.createWebApplicationContext(BootstrapContextLoader.java:34) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3025) at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:432) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1278) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559) at java.lang.Thread.run(Thread.java:595) Caused by: java.io.FileNotFoundException: C:\projects\StackWorkspace-2.1\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\stack-petstore\WEB-INF\classes\org\lds\stack\petstore\view\bean (Access is denied) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:85) at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:74) at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:68) at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:175) ... 32 more

    Spring JIRA | 9 years ago | Mike Youngstrom
    org.springframework.beans.factory.BeanDefinitionStoreException: I/O failure during classpath scanning; nested exception is java.io.FileNotFoundException: C:\projects\StackWorkspace-2.1\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\stack-petstore\WEB-INF\classes\org\lds\stack\petstore\view\bean (Access is denied)
  3. 0

    OpenGrok leaving too many open files. (Bugzilla #17127)

    GitHub | 4 years ago | vladak
    java.io.FileNotFoundException: /usr/local/tomcat/conf/web.xml (Too many open files)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    How to typically start kestrel on windows... in simple steps.

    GitHub | 5 years ago | nutharsh
    java.io.FileNotFoundException: \etc\kestrel.conf (The system cannot find the path specified)
  6. 0

    Graph Window in Overview Tab Fails to Load

    GitHub | 5 years ago | mbastian
    java.io.FileNotFoundException: /platform/modules/* (No such file or directory)

  1. r1chjames 1 times, last 1 day ago
  2. richard77 1 times, last 1 week ago
  3. gehel 2 times, last 2 weeks ago
  4. Kialandei 100 times, last 2 weeks ago
  5. Reich 1 times, last 2 weeks ago
45 more registered users
50 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. java.io.FileNotFoundException

    C:\projects\StackWorkspace-2.1\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\stack-petstore\WEB-INF\classes\org\lds\stack\petstore\view\bean (Access is denied)

    at java.io.FileInputStream.open()
  2. Java RT
    FileInputStream.<init>
    1. java.io.FileInputStream.open(Native Method)
    2. java.io.FileInputStream.<init>(FileInputStream.java:106)
    2 frames
  3. Spring Core
    CachingMetadataReaderFactory.getMetadataReader
    1. org.springframework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:85)
    2. org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:74)
    3. org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:68)
    3 frames
  4. Spring Context
    ComponentScanBeanDefinitionParser.parse
    1. org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:175)
    2. org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:192)
    3. org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:159)
    3 frames
  5. Spring Beans
    AbstractBeanDefinitionReader.loadBeanDefinitions
    1. org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
    2. org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1246)
    3. org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1236)
    4. org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)
    5. org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)
    6. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:488)
    7. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:383)
    8. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:327)
    9. org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:295)
    10. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    11. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
    12. org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
    12 frames
  6. org.lds.stack
    ResourceFilterableWebApplicationContext.loadBeanDefinitions
    1. org.lds.stack.spring.context.SpringContextUtils.loadBeanDefinitions(SpringContextUtils.java:49)
    2. org.lds.stack.spring.context.ResourceFilterableWebApplicationContext.loadBeanDefinitions(ResourceFilterableWebApplicationContext.java:27)
    2 frames
  7. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:97)
    2. org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:411)
    3. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:338)
    3 frames
  8. org.lds.stack
    BootstrapContextLoader.createWebApplicationContext
    1. org.lds.stack.spring.context.BootstrapContextLoader.createWebApplicationContext(BootstrapContextLoader.java:34)
    1 frame
  9. Spring
    ContextLoaderListener.contextInitialized
    1. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    2. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    2 frames
  10. Glassfish Core
    ContainerBase$ContainerBackgroundProcessor.run
    1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
    2. org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
    3. org.apache.catalina.core.StandardContext.reload(StandardContext.java:3025)
    4. org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:432)
    5. org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1278)
    6. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
    7. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
    8. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
    9. org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
    9 frames
  11. Java RT
    Thread.run
    1. java.lang.Thread.run(Thread.java:595)
    1 frame