转帖:
http://my.opera.com/relogout/blog/2006/10/12/java-comp-is-not-bound-in-this-context 在配置DBCP时遇到了JNDI的问题,java:comp is not bound in this Context ,下面这个buddy描述的问题和我一样:
Hi
I am trying to use connection pooling to establish adatabase connection. I am using Tomcat webserver. I have dbcp-coommon.*.jar and database connector jars in catalina lib. I have configured server.xml and web.xml as explained in the Tomcat sie. But I am not getting the initial lookup of (java:comp/env) I get the error as
javax.naming.NameNotFoundException: Name java:comp is not bound in this Context.
I have tried creating a seperate context in catalina\localhost. But still the error is same. Any idea... Reply please
在这里就死活过不去了。
查阅了很多资料,都是推荐检查web.xml和server.xml
很多人的问题是因为没有配置好web.xml里的内容
<resource-ref>
<description>JDBC Datasource</description>
<res-ref-name>jdbc/DT</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
看到了下面的帖子解决了问题
I have done eveything right but i had some other jar files in web-inf/classes/lib which i removed to get everything right. The jar files that interfere are naming-common.jar,naming-java.jar,naming-resources.jar,naming-factory.jar.
Hope it will work for u too
把虚拟目录下的naming-*.jar统统删除,$Tomcat$/common/lib/下的naming-*.jar不要动,restart tomcat就搞定了。令我迷茫了很久的问题就这样搞定了,是因为相同的jar包混淆了吗?
希望大家以后都不会出现这种问题。。。。。。
解决问题的帖子地址贴出来:http://forum.java.sun.com/thread.jspa?threadID=647982&messageID=3856064
分享到:
相关推荐
数据源可以不用写java:comp了,直接写ID和WEBLOGIC一样 数据源可以不用写java:comp了,直接写ID和WEBLOGIC一样数据源可以不用写java:comp了,直接写ID和WEBLOGIC一样
在Weblogic上配置Hibernate为JNDI
我加quine.bf测试实验室3使用is-lab-2-done.sh脚本,因为我懒。 预赛 git commit -am "WIP" # Commit your stuff if you need to git fetch upstream git merge upstream/lab3 git mergetool # if you see a ...
word源码java COMP603_Project AN AUT-COMP603 PROJECT! ---- Oct.14 2019 项目说明 本项目为AUT课程 COMP603 的 Assignment1 选题是:An English vocabulary (英语词汇) learning software 编码规范 缩进 采用设置4...
订阅系统源码java 作业 1 - 场地租用系统 截止日期:第 4 周,星期三,下午 5 点 价值:10分 宗旨 练习如何应用系统的面向对象设计过程 获得实现具有多个交互类的面向对象程序的经验 了解有关 Java 类库的更多信息 ...
订阅系统源码java 作业 1 - 场地租用系统 截止日期:第 4 周,星期三,下午 5 点 价值:10分 宗旨 练习如何应用系统的面向对象设计过程 获得实现具有多个交互类的面向对象程序的经验 了解有关 Java 类库的更多信息 ...
COMP-110:Comp 110分配
COMP-6651-Assignment-3-Q1:COMP 6651分配3 Q1
COMP 520:编译器PA2 - 抽象语法树编译器项目的第二个里程碑是为任何根据我们的 miniJava 语法在句法上有效的 miniJava 程序创建抽象语法树 (AST)。 此作业要求您结合 Java 运算符优先级规则,并使用本文档中概述的...
COMP1640:COMP1640-企业网站开发
A1:COMP 3512 A1