ClassUtils.forName() has thrown a ClassNotFoundException

java.lang.ClassNotFoundException
Javadoc
Thrown when an application tries to load in a class through its string name using:
  • The forName method in class Class.
  • The findSystemClass method in class ClassLoader .
  • The loadClass method in class ClassLoader.

but no definition for the class with the specified name could be found.

As of release 1.4, this exception has been retrofitted to conform to the general purpose exception-chaining mechanism. The "optional exception that was raised while loading the class" that may be provided at construction time and accessed via the {@link #getException()} method is now known as the cause, and may be accessed via the {@link Throwable#getCause()} method, as well as the aforementioned "legacy method." @author unascribed @see java.lang.Class#forName(java.lang.String) @see java.lang.ClassLoader#findSystemClass(java.lang.String) @see java.lang.ClassLoader#loadClass(java.lang.String, boolean) @since JDK1.0

at org.apache.catalina.loader.WebappClassLoader.loadClass
at org.apache.catalina.loader.WebappClassLoader.loadClass
at org.springframework.util.ClassUtils.forName
(source)

Typical Exception Messages

  1. org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
  2. Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'myDataSource' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
  3. Error creating bean with name 'web.context' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Unsatisfied dependency expressed through bean property 'clientRegistry': : Cannot find class [org.red5.server.WebScope] for bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.server.WebScope; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.red5.server.WebScope] for bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.server.WebScope
  4. Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/lyricsBaseApp-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
  5. Error registering portlets for SpringBook-portlet
  6. org.springframework.jdbc.datasource.DriverManagerDataSource
  7. Cannot find class [org.springframework.orm.hibernate4.LocalSessionFactoryBean] for bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.LocalSessionFactoryBean
  8. Cannot find class [org.spring.springframework.web.servlet.view.InternalResourceViewResolver] for bean with name 'viewResolver' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.spring.springframework.web.servlet.view.InternalResourceViewResolver
  9. Cannot find class [org.springframework.samples.petclinic.util.CallMonitoringAspect] for bean with name 'callMonitor' defined in class path resource [spring/tools-config.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.samples.petclinic.util.CallMonitoringAspect
  10. org.hibernate.cfg.AnnotationConfiguration

Origin

WebappClassLoader.loadClass() has thrown a ClassNotFoundException

java.lang.ClassNotFoundException
1 frames hidden
org.apache.catalina.loader.WebappClassLoader.loadClass
3613Web pages
1Solution

Similar

Specific cases

External results for this pattern (148)

  1. zstulxyvia GitHub4 months ago
    Error creating bean with name 'loginController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [spring/spring-context.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
    Show stack trace
  2. lorenzoguglielmovia GitHub5 months ago
    Error creating bean with name 'hbaseAgentEventDao': Unsatisfied dependency expressed through field 'hbaseOperations2'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.navercorp.pinpoint.web.dao.rest.GithubAgentDownloadInfoDao] for bean with name 'agentDownloadInfoDao' defined in class path resource [applicationContext-dao-config.xml]; nested exception is java.lang.ClassNotFoundException: com.navercorp.pinpoint.web.dao.rest.GithubAgentDownloadInfoDao
    Show stack trace
  3. Unknown authorvia algaworks.com5 months ago
    Cannot find class [br.com.siagri.portalcliente.security.AppUserDetailsService] for bean with name 'appUserDetailsService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: br.com.siagri.portalcliente.security.AppUserDetailsService
    Show stack trace
  4. Cannot find class [org.thymeleaf.templateresolver.ServletContextTemplateResolver] for bean with name 'templateResolver' defined in ServletContext resource [/WEB-INF/Resources/applicationContext-config.xml]; nested exception is java.lang.ClassNotFoundException: org.thymeleaf.templateresolver.ServletContextTemplateResolver
    Show stack trace
  5. JediPotPievia Stack Overflow5 months ago
    Cannot find class [com.ameren.eam.ldap.LdapDAONovellImpl] for bean with name 'testNovellDao' defined in ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: com.ameren.eam.ldap.LdapDAONovellImpl
    Show stack trace
  6. Unknown authorvia coderanch.com5 months ago
    Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'myDataSource' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
    Show stack trace
  7. Unknown authorvia coderanch.com5 months ago
    Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/lyricsBaseApp-servlet.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
    Show stack trace
  8. Unknown authorvia codecall.net5 months ago
    Error creating bean with name 'web.context' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Unsatisfied dependency expressed through bean property 'clientRegistry': : Cannot find class [org.red5.server.WebScope] for bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.server.WebScope; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.red5.server.WebScope] for bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.server.WebScope
    Show stack trace
  9. Unknown authorvia webhostingtalk.com5 months ago
    Error creating bean with name 'web.context' defined in ServletContext resource [/WEB-INF/red5-web.xml]: Unsatisfied dependency expressed through bean property 'clientRegistry': : Cannot find class [org.red5.server.WebScope] for bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.server.WebScope; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.red5.server.WebScope] for bean with name 'web.scope' defined in ServletContext resource [/WEB-INF/red5-web.xml]; nested exception is java.lang.ClassNotFoundException: org.red5.server.WebScope
    Show stack trace
  10. Unknown authorvia mkyong.com5 months ago
    Cannot find class [com.bnymellon.touchpoint.controller.TransactionBO] for bean with name 'BO' defined in ServletContext resource [/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: com.bnymellon.touchpoint.controller.TransactionBO
    Show stack trace