org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.security.AuthenticationServiceImpl] for bean with name 'AuthenticationService' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.security.AuthenticationServiceImpl

tip
Do you find the tips below useful? Click on the to mark them and say thanks to poroszd and rafael . Or join the community to write better ones.
  1. 0
    samebug tip
    You need to deploy aspectJ (aspectjweaver.jar) together with your application. Add it to your pom.xml
  2. 0
    samebug tip
    If you want to keep using @EnableWebMvc annotation, you have to add the code on the first answer of this page: https://goo.gl/JoHTKU to your code
  3. 0
    samebug tip
    Springboot auto-configuration is disabled when you try to use WebMvcConfigurerAdapter and @EnableWebMvc. If WebConfig is not of the essence, remove it and use SpringBoot auto-configuration.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    Your code probably has some syntax issue with how you're making the query request, more on this here: goo.gl/9wtLyd If your problem wasn't solved by that link, check this one as well: https://goo.gl/zBTzbl
  6. 0

    migration to hibernate4 - ZK Forum

    zkoss.org | 1 year ago
    org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.orm.hibernate4.HibernateTransactionManager] for bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/classes/spring/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.HibernateTransactionManager
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.lang.ClassNotFoundException

    com.security.AuthenticationServiceImpl

    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass()
  2. Glassfish Core
    WebappClassLoaderBase.loadClass
    1. org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1891)
    2. org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1734)
    2 frames
  3. Spring Core
    ClassUtils.forName
    1. org.springframework.util.ClassUtils.forName(ClassUtils.java:260)
    1 frame
  4. Spring Beans
    DefaultListableBeanFactory.getBeanNamesForType
    1. org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:416)
    2. org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1287)
    3. org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1258)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:581)
    5. org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1335)
    6. org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:356)
    7. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:335)
    8. org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:322)
    8 frames
  5. Spring Context
    AbstractApplicationContext.getBeanNamesForType
    1. org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1174)
    1 frame
  6. Spring MVC
    RequestMappingHandlerMapping.afterPropertiesSet
    1. org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:101)
    2. org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:87)
    3. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:163)
    3 frames
  7. Spring Beans
    DefaultListableBeanFactory.preInstantiateSingletons
    1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545)
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483)
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:524)
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
    5. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
    6. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    7. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
    8. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    9. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
    9 frames
  8. Spring Context
    AbstractApplicationContext.refresh
    1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
    2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
    2 frames
  9. Spring
    ContextLoaderListener.contextInitialized
    1. org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
    2. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
    3. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    3 frames
  10. Glassfish Core
    ContainerBase$StartChild.call
    1. org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5099)
    2. org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5615)
    3. org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
    4. org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
    5. org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
    5 frames
  11. Java RT
    Thread.run
    1. java.util.concurrent.FutureTask.run(FutureTask.java:266)
    2. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    3. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    4. java.lang.Thread.run(Thread.java:745)
    4 frames