ClassUtils.resolveClassName() has thrown an IllegalArgumentException

java.lang.ClassNotFoundException
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
ClassNotFoundException if the class was not found
at org.springframework.util.ClassUtils.resolveClassName
java.lang.IllegalArgumentException
Thrown to indicate that a method has been passed an illegal or inappropriate argument. @author unascribed @since JDK1.0
at org.springframework.util.ClassUtils.resolveClassName
IllegalArgumentException if the class name was not resolvable (that is, the class could not be found or the class file could not be loaded)
5 lines hidden

Matching stack traces (7)

  1. Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/config/sdnext-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.lang.Class[]' for property 'annotatedClasses'; nested exception is java.lang.IllegalArgumentException: Cannot find class [com.anand.model.Employee]
  2. HectorM Riveravia Coderanch1 year ago
    Error creating bean with name 'contactController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ctet.service.ContactService com.ctet.controller.ContactController.ContactService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ctet.dao.ContactDAO com.ctet.service.ContactServiceImpl.contactDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.ctet.dao.ContactDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/SpringMVC-servlet.xml]: 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 'configurationClass'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.hibernate.cfg.AnnotationConfiguration]
  3. chun ping wangvia Spring JIRA1 year ago
    Error creating bean with name 'methodSecurityInterceptor' nested exception is java.lang.IllegalArgumentException: Cannot find class [XmlfileServiceImpl]
  4. chun ping wangvia Spring JIRA2 years ago
    Error creating bean with name 'methodSecurityInterceptor' nested exception is java.lang.IllegalArgumentException: Cannot find class [XmlfileServiceImpl]
  5. Unknown authorvia yahoo.com2 years ago
    Error creating bean with name 'org.springframework.transaction.interceptor.TransactionInterceptor#0': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in ServletContext resource [/WEB-INF/conf/applicationContext.xml]: 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' defined in ServletContext resource [/WEB-INF/conf/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.util.ArrayList] to required type [java.lang.Class[]] for property 'annotatedClasses'; nested exception is java.lang.IllegalArgumentException: Cannot find class [test.granite.spring.entity.AbstractEntity]
  6. Nileshvia Stack Overflow2 years ago
    Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: 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 'annotatedClasses'; nested exception is java.lang.IllegalArgumentException: Cannot find class [com.contactmanager.dao.Contact]
  7. Unknown authorvia coderanch.com2 years ago
    Error creating bean with name 'contactController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ctet.service.ContactService com.ctet.controller.ContactController.ContactService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ctet.dao.ContactDAO com.ctet.service.ContactServiceImpl.contactDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contactDAOImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.hibernate.SessionFactory com.ctet.dao.ContactDAOImpl.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/SpringMVC-servlet.xml]: 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 'configurationClass'; nested exception is java.lang.IllegalArgumentException: Cannot find class [org.hibernate.cfg.AnnotationConfiguration]

See Also

Parent

9 web pages  - ClassUtils.resolveClassName() has thrown a ClassNotFoundException
java.lang.ClassNotFoundException
    at org.apache.catalina.loader.WebappClassLoader.loadClass()
    at org.apache.catalina.loader.WebappClassLoader.loadClass()
    at org.springframework.util.ClassUtils.forName()
    at org.springframework.util.ClassUtils.resolveClassName()

Siblings

  • 3 web pages  - TypeConverterDelegate.convertIfNecessary() has thrown a ClassNotFoundException
    java.lang.ClassNotFoundException
        at org.apache.catalina.loader.WebappClassLoader.loadClass()
        at org.apache.catalina.loader.WebappClassLoader.loadClass()
        at org.springframework.util.ClassUtils.forName()
        at org.springframework.util.ClassUtils.resolveClassName()
        at org.springframework.beans.propertyeditors.ClassEditor.setAsText()
        at org.springframework.beans.TypeConverterDelegate.doConvertTextValue()
        at org.springframework.beans.TypeConverterDelegate.doConvertValue()
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary()

Children

  • 4 web pages  - TypeConverterDelegate.convertIfNecessary() has thrown an IllegalArgumentException
    java.lang.IllegalArgumentException
        at org.springframework.util.ClassUtils.resolveClassName()
        at org.springframework.beans.propertyeditors.ClassEditor.setAsText()
        at org.springframework.beans.TypeConverterDelegate.doConvertTextValue()
        at org.springframework.beans.TypeConverterDelegate.doConvertValue()
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary()
        at org.springframework.beans.TypeConverterDelegate.convertIfNecessary()
    Caused by: java.lang.ClassNotFoundException
        at org.apache.catalina.loader.WebappClassLoader.loadClass()
        at org.apache.catalina.loader.WebappClassLoader.loadClass()
        at org.springframework.util.ClassUtils.forName()
        at org.springframework.util.ClassUtils.resolveClassName()

Typical exception messages

  1. 2 crashes - Cannot find class [org.hibernate.cfg.AnnotationConfiguration]
  2. 2 crashes - Cannot find class [XmlfileServiceImpl]
  3. 1 crashes - Cannot find class [com.contactmanager.dao.Contact]
  4. 1 crashes - Cannot find class [test.granite.spring.entity.AbstractEntity]
  5. 1 crashes - Cannot find class [com.anand.model.Employee]