java.lang.reflect.InvocationTargetException

Spring JIRA | Miguel Goncalves | 4 years ago
  1. 0

    Project work's in Eclipse, but don't work in command line. Stack trace: Jun 23, 2012 1:49:00 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@670655dd: startup date [Sat Jun 23 13:49:00 WEST 2012]; root of context hierarchy Jun 23, 2012 1:49:00 PM org.springframework.core.io.support.PathMatchingResourcePatternResolver doFindPathMatchingFileResources WARNING: Cannot search for matching files underneath URL [rsrc:tests/] because it does not correspond to a directory in the file system java.io.FileNotFoundException: URL [rsrc:tests/] cannot be resolved to absolute file path because it does not reside in the file system: rsrc:tests/ at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:205) at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52) at org.springframework.core.io.UrlResource.getFile(UrlResource.java:169) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:526) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:347) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:266) at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1245) at org.springframework.context.support.GenericApplicationContext.getResources(GenericApplicationContext.java:226) at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:228) at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242) at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:124) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:214) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:149) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:135) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:260) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:617) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446) at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:73) at tests.controller.MainCtrl.main(MainCtrl.java:20) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Jun 23, 2012 1:49:00 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1d2940b3: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,springConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [tests.controller.MainCtrl] is defined: expected single bean but found 0: at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:271) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1101) at tests.controller.MainCtrl.main(MainCtrl.java:23) ... 5 more

    Spring JIRA | 4 years ago | Miguel Goncalves
    java.lang.reflect.InvocationTargetException
  2. 0

    Project work's in Eclipse, but don't work in command line. Stack trace: Jun 23, 2012 1:49:00 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@670655dd: startup date [Sat Jun 23 13:49:00 WEST 2012]; root of context hierarchy Jun 23, 2012 1:49:00 PM org.springframework.core.io.support.PathMatchingResourcePatternResolver doFindPathMatchingFileResources WARNING: Cannot search for matching files underneath URL [rsrc:tests/] because it does not correspond to a directory in the file system java.io.FileNotFoundException: URL [rsrc:tests/] cannot be resolved to absolute file path because it does not reside in the file system: rsrc:tests/ at org.springframework.util.ResourceUtils.getFile(ResourceUtils.java:205) at org.springframework.core.io.AbstractFileResolvingResource.getFile(AbstractFileResolvingResource.java:52) at org.springframework.core.io.UrlResource.getFile(UrlResource.java:169) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.doFindPathMatchingFileResources(PathMatchingResourcePatternResolver.java:526) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.findPathMatchingResources(PathMatchingResourcePatternResolver.java:347) at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:266) at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1245) at org.springframework.context.support.GenericApplicationContext.getResources(GenericApplicationContext.java:226) at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:228) at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242) at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:124) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:214) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:149) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:135) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:260) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:617) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:446) at org.springframework.context.annotation.AnnotationConfigApplicationContext.<init>(AnnotationConfigApplicationContext.java:73) at tests.controller.MainCtrl.main(MainCtrl.java:20) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Jun 23, 2012 1:49:00 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1d2940b3: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,springConfig,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [tests.controller.MainCtrl] is defined: expected single bean but found 0: at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:271) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1101) at tests.controller.MainCtrl.main(MainCtrl.java:23) ... 5 more

    Spring JIRA | 4 years ago | Miguel Goncalves
    java.lang.reflect.InvocationTargetException
  3. 0

    SVN / if not used, exception are returned

    GitHub | 3 years ago | fxprunayre
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.fao.geonet.kernel.SvnManager] is defined: expected single bean but found 0:
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    NoSuchBeanDefinitionException with spring and gwt (requestFactory)

    Stack Overflow | 4 years ago | robert trudel
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.calibra.server.service.AccountService] is defined: expected single bean but found 0:
  6. 0

    Failure running spring application : NoSuchBeanDefinitionException

    Stack Overflow | 3 years ago | l0r3nz4cc10
    org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [fr.aaa.accounting.Computation] is defined: expected single bean but found 0:

  1. Gatgeagent 4 times, last 2 months ago
  2. Pilleo 6 times, last 2 months ago
  3. qavid 2 times, last 6 months ago
  4. MrMonkey 3 times, last 8 months ago
  5. Piz 2 times, last 4 months ago
2 more registered users
19 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.NoSuchBeanDefinitionException

    No unique bean of type [tests.controller.MainCtrl] is defined: expected single bean but found 0:

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean()
  2. Spring Beans
    DefaultListableBeanFactory.getBean
    1. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:271)
    1 frame
  3. Spring Context
    AbstractApplicationContext.getBean
    1. org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1101)
    1 frame
  4. tests.controller
    MainCtrl.main
    1. tests.controller.MainCtrl.main(MainCtrl.java:23)
    1 frame
  5. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:616)
    4 frames
  6. org.eclipse.jdt
    JarRsrcLoader.main
    1. org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
    1 frame