myeclipse抛出异常

 org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in URL [file:/opt/app-w/apache-tomcat-7.0./webapps/telemetry/WEB-INF/classes/spring/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:)
at java.util.concurrent.FutureTask.run(FutureTask.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at java.lang.Thread.run(Thread.java:)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:)
... more
-- :: org.springframework.web.context.ContextLoader ERROR Context initialization failed

解决方法:

缺少commons-dbcp.jar、commons-pool.jar这两个包

在pom.xml中加入:

    <dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency> <dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.6</version>
</dependency>

关于Spring配置 (Cannot find class [org.apache.commons.dbcp.BasicDataSource] 问题)的更多相关文章

  1. spring+hibernate 整合异常 Class 'org.apache.commons.dbcp.BasicDataSource' not found

    解决方法 添加 commons-dbcp.jar和commons-pool.jar包

  2. 对于org.apache.commons.dbcp.BasicDataSource的配置认知

    对于org.apache.commons.dbcp.BasicDataSource的配置认知[转] Spring在第三方依赖包中包含了两个数据源的实现类包,其一是Apache的DBCP,其二是 C3P ...

  3. class"org.apache.commons.dbcp.BasicDataSource"not found出错的解决办法

    法1:在项目上右击build path->configure build path..->add library..->MyEclipse Libraries选中Spring 2.0 ...

  4. Cannot find class [org.apache.commons.dbcp.BasicDataSource]

    错误:Cannot find class [org.apache.commons.dbcp.BasicDataSource] 原因:缺少commons-dbcp.jar

  5. java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource解决方法

    java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource解决方法 只需把这三个commons-pool.jar ...

  6. MyBatis笔记----(2017年)最新的报错:Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [com/ij34/mybatis/applicationContext.xml]; nested e

    四月 05, 2017 4:56:11 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRef ...

  7. Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [applicationContext.xml]

    Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined ...

  8. Spring 整合Mybatis 出现了Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create Poola

    我出现的 报错信息如下: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionExc ...

  9. org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class

    转载自:http://songjianyong.iteye.com/blog/1663170 org.springframework.transaction.CannotCreateTransacti ...

随机推荐

  1. 作为iOS开发者不得不follow的52人

    对于每位iOS开发者来说,Twitter是个获得最新iOS开发技术和相关信息的好地方.如果你刚好有Twitter账户,可以关注以下为你推荐的该领域内的52个优秀人物. 1.Tim Cook 这位无需多 ...

  2. ShareSDK.xml 配置

    简要说明 <ShareSDK AppKey="1089fa233237e" /> <!-- 修改成你在sharesdk后台注册的应用的appkey" - ...

  3. nyoj 2

    #include <iostream> #include <stack> #include <string.h> #include <stdio.h> ...

  4. [ERROR] Unknown/unsupported storage engine: InnoDB

    将CentOS上的mysql升级以后,出现无法启动服务的问题.运行mysqld_safe后查看log信息,看到标题所示的错误.搜索以后发现是配置不对,难道两个版本的配置不能互相兼容?那还叫升级?坑爹啊 ...

  5. Swift - 34 - 闭包的基础语法

    //: Playground - noun: a place where people can play import UIKit // 初始化一个整数数组 var arr = [1, 3, 5, 7 ...

  6. CADisplayLink的简单使用

    CADisplayLink类似NSTimer是一个定时器,只不过是一秒会调用60次指定的方法 使用方法: #import "ViewController.h" @interface ...

  7. PHP防注入转义功能

    PHP addslashes() 函数 $str = addslashes('Shanghai is the "biggest" city in China.'); echo($s ...

  8. [转]机器学习——C4.5 决策树算法学习

    1. 算法背景介绍 分类树(决策树)是一种十分常用的分类方法.它是一种监管学习,所谓监管学习说白了很简单,就是给定一堆样本,每个样本都有一组属性和一个类别,这些类别是事先确定的,那么通过学习得到一个分 ...

  9. Oracle数据库之PL/SQL游标

    1. 游标概念 字面意思是游动的光标,是指向上下文区域的句柄或指针. 在PL/SQL块中执行CRUD操作时,ORACLE会在内存中为其分配上下文区.用数据库语言来描述游标就是:映射在上下文区结果集中一 ...

  10. jquery的节点查询

    jQuery.parent(expr)           //找父元素 jQuery.parents(expr)          //找到所有祖先元素,不限于父元素 jQuery.children ...