javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
[2011-11-23 00:41:28] runqianReportLogger : [ERROR] - Name jdbc is not bound in this Context
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.runqian.report4.dataset.JNDIConnectionFactory.<init>(Unknown Source:13)
at com.runqian.report4.view.ReportServlet._$1(Unknown Source:398)
at com.runqian.report4.view.ReportServlet._$1(Unknown Source:352)
at com.runqian.report4.view.ReportServlet.init(Unknown Source:173)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
[AC] 2011-11-23 00:41:28,308 ERROR [main] Logger.error(46) | Name jdbc is not bound in this Context
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:769)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:139)
at org.apache.naming.NamingContext.lookup(NamingContext.java:780)
at org.apache.naming.NamingContext.lookup(NamingContext.java:152)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.runqian.report4.dataset.JNDIConnectionFactory.<init>(Unknown Source:13)
at com.runqian.report4.view.ReportServlet._$1(Unknown Source:398)
at com.runqian.report4.view.ReportServlet._$1(Unknown Source:352)
at com.runqian.report4.view.ReportServlet.init(Unknown Source:173)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
分析个人产生错误的原因 ,本身在Tomcat中的config/server.xml文件中 有个<context 配置 指向的是 /psdb>我删除了>想直接采用tomcat自动发布的时候产生了这样一个问题.
分析了好多产生的原因:最后 在web.xml文件中添加了
<!-- 后边添加的 -->
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/psdb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
采用的服务器版本是:tomcat5.X
解决了以上的问题,以上内容归个人总结,如有转载请附带出处!
阅读更多- javax.naming.NameNotFoundException: Name jdbc is 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
- javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
- javax.naming.NameNotFoundException: Name jdbcis not bound in this Context
- Tomcat配置连接池 异常:javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
- 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
- GWT + Spring : javax.naming.NameNotFoundException: Name userDao is not bound in this Context
- javax.naming.NameNotFoundException: Name ZKING is not bound in this Context 的问题
- javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [co
- javax.naming.NameNotFoundException Name java:comp is not bound in this Context之解决
- 启动Tomcat时出现javax.naming.NameNotFoundException: Name xxx is not bound in this Context情况解决方式
- javax.naming.NameNotFoundException: Name jms is not bound in this Context
- javax.naming.NameNotFoundException:Name[ XXX] is not bound in this context.
- javax.naming.NameNotFoundException: Name spring.liveBeansView.mbeanDomain is not bound in this Conte
- javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".
- Name jdbc is not bound in this Context
- Tomcat 配置 JNDI数据源出现Name jdbc is not bound in this Context