`
terry0501
  • 浏览: 313664 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

is not bound in this Context. Unable to find [jdbc].

 
阅读更多
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [jdbc/topcfsbs] is not bound in this Context. Unable to find [jdbc].
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean(AbstractBeanFactory.java:1421)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean(AbstractAutowireCapableBeanFactory.java:802)
at org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch(AbstractBeanFactory.java:542)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:436)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:412)
at org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(BeanFactoryUtils.java:186)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1105)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1288)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1195)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4633)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5095)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:657)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:355)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:495)
Caused by: javax.naming.NameNotFoundException: Name [jdbc/topcfsbs] is not bound in this Context. Unable to find [jdbc].
at org.apache.naming.NamingContext.lookup(NamingContext.java:817)
at org.apache.naming.NamingContext.lookup(NamingContext.java:173)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:163)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:179)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:104)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:106)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:231)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:217)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
... 71 more
解决办法
1.  <Resource auth="Container" factory="com.alibaba.druid.pool.DruidDataSourceFactory"
        initialSize="10" maxActive="100" maxWait="60000" useUnfairLock="true"
        minIdle="10" poolPreparedStatements="false" maxOpenPreparedStatements="200"
        validationQuery="select 1 from dual" validationQueryTimeout="60000"
        testOnBorrow="false" testOnReturn="false" testWhileIdle="true"
        timeBetweenEvictionRunsMillis="60000" minEvictableIdleTimeMillis="1800000"
        removeAbandoned="true" removeAbandonedTimeout="1800" logAbandoned="true"
        name="jdbc/topcfsbs" username="shenma" password="shenma"
        type="javax.sql.DataSource" url="jdbc:oracle:thin:@139.196.85.202:30681:shenma"
        filters="stat"
        connectionProperties="druid.stat.mergeSql=true,druid.stat.slowSqlMillis=5000,druid.stat.logSlowSql=false" />
2.添加 jar
分享到:
评论

相关推荐

    数据池连接Name jdbc is not bound in this Context解决方案

    在这个问题中,开发者遇到了一个常见的错误:“Name jdbc is not bound in this Context”,这通常意味着在Tomcat的环境中,指定的数据源没有被正确地绑定或配置。 要解决这个问题,首先需要在Tomcat的配置文件中...

    Tomcat启动时报错:Name salesDataSource is not bound in this Context

    Name salesDataSource is not bound in this Context,连接池的问题

    servlet2.4doc

    Returns the object bound with the specified name in this session, or null if no object is bound under the name. getAttributeNames() - Method in interface javax.servlet.ServletContext Returns an ...

    Problem.Solving.in.Data.Structures.and.Algorithms.Using.Cplusplus.epub

    This book is about the usage of data structures and algorithms in computer programming. Designing an efficient algorithm to solve a computer science problem is a skill of Computer programmer. This is ...

    数位板压力测试

    This specification was developed in response to a perceived need for a standardized programming inter-face to digitizing tablets, three dimensional position sensors, and other pointing devices by a ...

    struts1中所遇到的配置问题

    本文主要针对一个常见的配置错误——“Name jdbc is not bound in this Context”以及“Cannot create JDBC driver of class '' for connect URL 'null'”,进行深入分析并提供解决方案。 #### 错误现象及原因分析 ...

    lower-bound函数应用案例.zip

    在C++标准库中,`lower_bound`是一个非常重要的算法,它属于`&lt;algorithm&gt;`头文件。`lower_bound`函数通常用于排序好的容器(如数组或向量)中,找到给定值的第一个大于或等于该值的元素的位置。这个位置被称为“下界...

    plan_project.zip

    【标题】"plan_project.zip" 是一个包含Spring Boot与Dubbo整合示例代码的压缩包。这个项目旨在帮助开发者理解如何在Spring Boot框架中集成Dubbo服务,以便构建分布式微服务架构。 【描述】提到,这个项目包含了...

    lower-bound 的简要介绍.docx

    ### Lower_bound 函数详解 #### 一、概述 `lower_bound`是C++标准模板库(STL)中的一个重要函数,主要用于在一个有序序列中查找指定元素的位置。此函数广泛应用于算法设计与数据处理中,特别是在搜索操作方面具有...

    org.hibernate.HibernateException: No Hibernate Session bound to thread

    然而,在使用 Hibernate 进行数据库操作时,经常会遇到 "No Hibernate Session bound to thread" 的错误信息。本文将详细介绍该错误的解决方案。 错误原因 "No Hibernate Session bound to thread" 错误信息通常是...

    tomcat6中配置JNDI方法

    - **错误3**: `Name jdbc is not bound in this context` - 解决方法:检查`web.xml`和`context.xml`中的配置是否一致,确保所有配置都正确无误。 #### 五、总结 通过以上步骤,我们可以在Tomcat6环境中成功配置...

    C++ lower-bound()函数.docx

    ### C++ 中 `lower_bound()` 函数详解 `lower_bound()` 是 C++ Standard Template Library (STL) 中的一个非常实用的算法,它主要用于在有序序列中查找满足特定条件的元素。该函数通常被用于需要高效查找操作的应用...

    Acdsee9绿色版

    If You do not agree to be bound by this Agreement, remove this Software from Your computer now and, if applicable, promptly return to acd by mail any copies of this Software and related documentation ...

    RabbitMQ for Android

    A connection is set up and the queue is bound to group ids. MainActivity starts a service in background which handles the connection with the server. I'm using `EventBus` to communicate between ...

    lodash underscore js库速查手册

    The iterator is bound to the _.map(list, iterator, [context]) Alias: collect Produces a new array of values by mapping each value in list through a transformation function ( _.reduce(list, iterator, ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    The goal of this guide is to manage this complexity by describing in detail the dos and don'ts of writing C++ code. These rules exist to keep the code base manageable while still allowing coders to ...

    JNDI数据源配置[文].pdf

    3. **`Name jdbc is not bound in this context`** - 解决方法:检查`web.xml`中的`res-ref-name`属性是否与`context.xml`或`server.xml`中的`name`属性相匹配。 #### 四、总结 通过以上两种方案,可以有效地配置...

    DevExpress.XtraTreeList.Net.v1.7.0.Incl.Source

    The XtraTreeList is a multi-purpose data visualization system that can display information as a TREE, a GRID, or a combination of both - in either data-bound or unbound mode. This unique synergy ...

Global site tag (gtag.js) - Google Analytics