首页 > 代码库 > 01.Eclipse tomcat数据源配置Unable to find [jdbc]
01.Eclipse tomcat数据源配置Unable to find [jdbc]
一、问题情境
通常情况下如果eclipse中配置tomcat时,本地tomcat本地目录中的context.xml没有配置数据源时,
eclipse中配置tomcat已经配置完成,在其中运行web项目时,会报如下错误
Unable to find [jdbc].
警告: Bean creation exception on non-lazy FactoryBean type check: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘mapper.ImplicitCollectionMapping‘ defined in URL [jar:file:/D:/JAVA开发资料/eclipse_workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/hap/WEB-INF/lib/xstream-1.4.1.jar!/com/thoughtworks/xstream/mapper/Mapper$ImplicitCollectionMapping.class]: Unsatisfied dependency expressed through bean property ‘sqlSessionFactory‘: Error creating bean with name ‘sqlSessionFactory‘ defined in file [D:\JAVA开发资料\eclipse_workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\hap\WEB-INF\classes\spring\applicationContext.xml]: Cannot resolve reference to bean ‘dataSource‘ while setting bean property ‘dataSource‘; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dataSource‘ defined in file [D:\JAVA开发资料\eclipse_workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\hap\WEB-INF\classes\spring\applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [jdbc/hap_dev] is not bound in this Context. Unable to find [jdbc].; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory‘ defined in file [D:\JAVA开发资料\eclipse_workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\hap\WEB-INF\classes\spring\applicationContext.xml]: Cannot resolve reference to bean ‘dataSource‘ while setting bean property ‘dataSource‘; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘dataSource‘ defined in file [D:\JAVA开发资料\eclipse_workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\hap\WEB-INF\classes\spring\applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [jdbc/hap_dev] is not bound in this Context. Unable to find [jdbc].
二、eclipse中配置tomcat重新配置数据源
按照如图配置即可
三、JNDI配置方法
http://blog.csdn.net/sunvsjay1890/article/details/52694285
http://www.cnblogs.com/xuan52rock/p/4745241.htmlnull
01.Eclipse tomcat数据源配置Unable to find [jdbc]
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。