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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

This is thrown when the JVM tries to load a particular class and the specified class cannot be found in the classpath. Make sure Apache commons-lang library jar is added to your project's build path and you are using commons-lang3-3.0.jar or greater.

,

Make sure to add org.springframework.core-3.1.0.M2.jar to your project libraries so that org.springframework.core.env.EnvironmentCapable will be loaded.

Solutions on the web

via Stack Overflow by Syed
, 1 year ago
Cannot find class [com.cnc.cnccontroller.CncController] for bean with name '/welcome.html' defined in ServletContext resource [/WEB-INF/cnc- dispatcher-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.cnc.cnccontroller.CncController
via com.br by Unknown author, 1 year ago
Cannot find class [org.springframework.orm.jpa. LocalContainerEntityManagerFactoryBean] for bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.jpa. LocalContainerEntityManagerFactoryBean
via com.br by Unknown author, 1 year ago
Error loading class [com.digows.artigos.JavaFlex.model.repository.hibernate.CargoHibernateDao] for bean with name 'cargoRepository' defined in null: problem with class file or dependent class; nested exception is java.lang.NoClassDefFoundError: org/springframework/orm/hibernate3/support/HibernateDaoSupport
via libreplan.org by Unknown author, 2 years ago
Cannot find class [org.springframework.orm.hibernate4.HibernateTransactionManager] for bean with name 'transactionManager' defined in URL [file:/C:/mvnpro/libreplan/libreplan-business/target/classes/libreplan-business-spring-config.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.hibernate4.HibernateTransactionManager
via Stack Overflow by SmartJill
, 1 year ago
Cannot find class [oracle.jdbc.pool.OracleDataSource] for bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]; nested exception is java.lang.ClassNotFoundException: oracle.jdbc.pool.OracleDataSource from [Module "deployment.RSAccessMgmt.war:main" from Service Module Loader]
via Google Groups by Unknown author, 10 months ago
Error loading class [com.shopizer.search.utils.CustomIndexFieldConfiguration] for bean with name 'field2' defined in class path resource [spring/shopizer-search.xml]: problem with class file or dependent class; nested exception is
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.cnc.cnccontroller.CncController] for bean with name '/welcome.html' defined in ServletContext resource [/WEB-INF/cnc- dispatcher-servlet.xml]; nested exception is java.lang.ClassNotFoundException: com.cnc.cnccontroller.CncController
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1332)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:385)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1177)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:222)
at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:75)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4842)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

Once, 8 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
3 times, 1 year ago
32 times, 1 month ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.