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 java.net.URLClassLoader.findClass
(source)
at java.lang.ClassLoader.loadClass
(source)
at sun.misc.Launcher$AppClassLoader.loadClass
(source)
at java.lang.ClassLoader.loadClass
(source)
at org.springframework.util.ClassUtils.forName
(source)
4 frames hidden

Typical Exception Messages

  1. Failed to load ApplicationContext
  2. Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class' for property 'configClass'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.grails.plugin.hibernate.filter.HibernateFilterDomainConfiguration]
  3. Listener threw exception
  4. Cannot find class [org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration]
  5. Error processing condition on org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration.pageableCustomizer
  6. Error creating bean with name 'batchPropertyPostProcessor': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.batch.core.jsr.launch.support.BatchPropertyBeanPostProcessor.setBatchPropertyContext(org.springframework.batch.core.jsr.configuration.support.BatchPropertyContext); nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [dataListingStepListener] for bean with name 'scopedTarget.dataListingStepListener' defined in null; nested exception is java.lang.ClassNotFoundException: dataListingStepListener
  7. Cannot find class [com.nri.saccr.engine.AssetClassCalculationService] for bean with name 'BeanIAssetClassCalculationService' defined in URL [file:resources/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: com.nri.saccr.engine.AssetClassCalculationService
  8. org.alfresco.repo.events.EventPublisherF orTestingOnly
  9. Unable to start transaction. Could not retrieve PlatformTransactionManager from the Spring application context. Make sure either to configure one, or use another Unitils transaction manager. (e.g. SimpleTransactionManager, by setting the property 'transactionManager.type' to 'simple')
  10. Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Class' for property 'contextClass'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.springframework.web.context.support.AnnotationConfigWebApplicationContext]

Origin

ClassLoader.loadClass() has thrown a ClassNotFoundException

java.lang.ClassNotFoundException
3 frames hidden
java.lang.ClassLoader.loadClass
4672Web pages
1Solution

Similar

Specific cases

External results for this pattern (30)

  1. chrismathewsvia GitHub1 month ago
    Failed to load ApplicationContext
    Show stack trace
  2. kennonbvia GitHub1 month ago
    Cannot find class [org.psidnell.omnifocus.sqlite.SQLiteDataSource] for bean with name 'sqLiteDS' defined in class path resource [config.xml]; nested exception is java.lang.ClassNotFoundException: org.psidnell.omnifocus.sqlite.SQLiteDataSource
    Show stack trace
  3. tetsushiawanovia GitHub2 months ago
    Unable to instantiate factory class: org.springframework.boot.env.EnvironmentPostProcessor
    Show stack trace
  4. miaosakuraivia GitHub2 months ago
    Error processing condition on com.microsoft.azure.spring.cloud.autoconfigure.keyvault.AzureKeyVaultAutoConfiguration.keyVaultOperation
    Show stack trace
  5. luisfguzmanvia GitHub3 months ago
    Error processing condition on com.okta.spring.oauth.OktaTokenServicesConfig$LocalTokenValidationConfig.authoritiesExtractor
    Show stack trace
  6. duanwen livia Stack Overflow4 months ago
    Cannot find class [org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration]
    Show stack trace
  7. Chintamanivia Stack Overflow4 months ago
    Cannot find class [org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration]
    Show stack trace
  8. Dav1ddevia GitHub4 months ago
    Cannot load configuration class: org.springframework.cloud.context.refresh.ContextRefresher$Empty
    Show stack trace
  9. TommyYehCoolvia GitHub4 months ago
    Error creating bean with name 'org.springframework.boot.test.web.client.TestRestTemplate': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Could not find class [org.springframework.http.client.OkHttpClientHttpRequestFactory]
    Show stack trace
  10. Nithinvia Stack Overflow5 months ago
    Error creating bean with name 'c': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: beans.Engine beans.Car.engine; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [bean.Engine] for bean with name 'e1' defined in class path resource [resources/spring.xml]; nested exception is java.lang.ClassNotFoundException: bean.Engine
    Show stack trace