Name jdbc is not bound in this Context
2017-01-05 00:03
453 查看
简介
今天接手中行一个交通罚款web工程时,从svn同步下来后,,启动竟然报找不到数据源错误,本来以为很简单解决找了两个小时,现在记录下来。
Exception: Name jdbc is not bound in this Context'
这个错误网络上一大堆。
1、WEB-INF里的web.xml文件中没有以下配置或者是配置错误:
2、我们在Tomcat安装文件中找到 conf/context文件并打开, 在这里,我以我用的Oracle数据库
来配置。
而在WEB-INF文件下的 web.xml中,我们配置
<resource-ref></resource-ref> 的信息必须与Tomcat中的配置信息一一对应。
例如:
在Tomcat中配置的name='jdbc/oracleds' ,而在 web.xml文件中配置的name='jdbc/oracled'都会引起
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context 错误提示!
3、在spring配置文件中引用jdbc/oracleds时,应该前面加上java:comp/env/,全名为java:comp/env/jdbc/oracleds,否则也会报同样的错误
今天接手中行一个交通罚款web工程时,从svn同步下来后,,启动竟然报找不到数据源错误,本来以为很简单解决找了两个小时,现在记录下来。
Exception: Name jdbc is not bound in this Context'
这个错误网络上一大堆。
1、WEB-INF里的web.xml文件中没有以下配置或者是配置错误:
<resource-ref> <description>jdbc/oracleds</description> <res-ref-name>jdbc/oracleds</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
2、我们在Tomcat安装文件中找到 conf/context文件并打开, 在这里,我以我用的Oracle数据库
来配置。
<Resource name='jdbc/oracleds' auth='Container' type='javax.sql.DataSource' maxIdle='30' maxActive='10' maxWait='1000' username='scott' password='113416' driverClassName='oracle.jdbc.OracleDriver' url='jdbc:oracle:thin:@127.0.0.1:1521:SNAIL'/>
而在WEB-INF文件下的 web.xml中,我们配置
<resource-ref></resource-ref> 的信息必须与Tomcat中的配置信息一一对应。
例如:
在Tomcat中配置的name='jdbc/oracleds' ,而在 web.xml文件中配置的name='jdbc/oracled'都会引起
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context 错误提示!
3、在spring配置文件中引用jdbc/oracleds时,应该前面加上java:comp/env/,全名为java:comp/env/jdbc/oracleds,否则也会报同样的错误
相关文章推荐
- 关于出现Name jdbc is not bound in this Context错误的解决
- javax.naming.NameNotFoundException: Name jdbcis not bound in this Context
- javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
- javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
- 数据源没发现! Name [jdbc/mysql5] is not bound in this Context. Unable to find [jdbc].
- Name jdbc is not bound in this context
- Name jdbc is not bound in this Context
- javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
- 应对Name jdbc is not bound in this Context-----------我的一个总结
- javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
- Tomcat 配置 JNDI数据源出现Name jdbc is not bound in this Context
- Tomcat上配置连接池{ connect error=Name [jdbc/OracleDB] is not bound in this Context. Unable to find [jdbc]}
- Tomcat配置连接池 异常:javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
- javax.naming.NameNotFoundException: Name [jdbc/lappJDBC] is not bound in this Context. Unable to fi
- 解决javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
- javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
- Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find
- javax.naming.NameNotFoundException Name java:comp is not bound in this Context之解决
- javax.naming.NameNotFoundException: Name jms is not bound in this Context
- name jndi is not bound in this context