警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'oracleDataSource' defined in class path resource [com/h/spring/start/mybatis/mybatisConStart.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'oracleDataSource' defined in class path resource [com/h/spring/start/mybatis/mybatisConStart.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource ?? ?at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1380) ?? ?at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:670) ?? ?at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:637) ?? ?at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1489) ?? ?at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1007) ?? ?at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:739) ?? ?at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) ?? ?at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ?? ?at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144) ?? ?at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85) ?? ?at com.h.spring.start.aop.annotationCon.annotationConStart.main(annotationConStart.java:12) Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource ?? ?at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ?? ?at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ?? ?at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ?? ?at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ?? ?at org.springframework.util.ClassUtils.forName(ClassUtils.java:255) ?? ?at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:418) ?? ?at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1428) ?? ?at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1372) ?? ?... 10 more |
经排查分析是因为缺少commons-dbcp.jar、commons-pool.jar 导致的
下载地址为:common-jars.zip-数据库文档类资源-CSDN下载
|