易截截图软件、单文件、免安装、纯绿色、仅160KB

Name java:comp is not bound in this Context

 
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
在tomcat中发布web项目,可能是因为spring中配置了jndi(只配置了jndi,其他的有工具包封装了)。
启动的时候报错(在项目目录下,在tomcat中配置context指向项目目录就没问题,打包发布到
tomcat就报错了),抛的异常是:
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
在web.xml中添加配置如下:
<resource-ref>
  <description>DB Connection</description>
  <res-ref-name>jdbc/test</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>
===================================
Name java:comp is not bound in this Context
javax.naming.NameNotFoundException: Name java:comp is not bound in this Context
--这是在初始化context时(Context envCtx = (Context)
ctx.lookup("java:comp/env");)抛出的异常;解决方法是把工程/WEB-INF/lib下面naming-
common.jar,naming-factory.jar,naming-resources.jar三个jar包删除;
http://hi.baidu.com/salala1/blog/item/c9e6f3ed7d2a9d4778f05510.html
===================================
第一种没解决;
第二种应该是tomcat/common/lib下的文件和WEB-INF/lib下的文件冲突造成的。解决问题


相关文档:

Project Zero、WebSphere sMash、PHP和JAVA的整合


从架构设计方面考虑,很多系统采用了 Java Bridge把php和JAVA技术结合起来,利用PHP的快速响应和JAVA的数据持久化能力,能很大程度上能提高系统性能。这两篇文章将详细的介绍Project Zero、WebSphere sMash 和 PHP 的整合技术
Project Zero、WebSphere sMash 和 PHP 入门
http://www.ibm.com/developerworks/cn/web/wa- ......

java面试题及答案(基础题122道,代码题19道)

 JAVA相关基础知识
1、面向对象的特征有哪些方面
1.抽象:
抽象就是忽略一个主题中与当前目标无关的那些方面,以便更充分地注意与当前目标有关的方面。抽象并不打算了解全部问题,而只是选择其中的一部分,暂时不用部分细节。抽象包括两个方面,一是过程抽象,二是数据抽象。
2.继承:

承是一种联结类的层 ......

java 列出斐波那契数列的前n项

public class Fibonacci {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub

NumOfFibonacci(9);
}

public static int MyFibonacci(int i){
if(i>0) {
if(i == 1)return 1;
if(i == 2)return 1;
else return MyFibonacc ......

java中this关键字用法

 /**
* this关键字用法
*/
public class Flower {

int petalCount = 0;
String s = "initial value";

Flower(int petals){
petalCount = petals;
System.out.println("Constructor with one int arg");
}

Flower(String ss){
System.out.println("Constr ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号