1)启动Tomcat服务器,打开浏览器,输入http://localhost:8080/admin(其中localhost是名称服务器或称为主机),
进入管理界面的登陆页面,这时候请输入原来安装时要求输入的用户名和密码,登陆到管理界面,

2)选择Resources-Data sources进入配置数据源界面,选择
 Data Source Actions ->选择Create New Data Source,进入配置详细信息界面
主要内容例如下:
JNDI Name:   ->jdbc/mysql
Data Source URL  ->jdbc:mysql://localhost:3306/test
JDBC Driver Class-> org.gjt.mm.mysql.Driver
3)修改\conf\Catalina\localhost目录下建立一个xml文件,名称为你所发布的web应用的名称.xml,(如testpool.xml)打开添加内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
 <Resource
      name="jdbc/mysql"
      type="javax.sql.DataSource"
      password="123456"
      driverClassName="org.gjt.mm.mysql.Driver"
      maxIdle="2"
      maxWait="50"
      username="root"
      url="jdbc:mysql://localhost:3306/test"
      maxActive="4"/>

</Context>
内容同conf/server.xml中<GlobalNamingResources>
 <Resource
      name="jdbc/mysql"
      type="javax.sql.DataSource"
      password="123456"
      driverClassName="org.gjt.mm.mysql.Driver"
      maxIdle="2"
      maxWait="50"
      username="root"
      url="jdbc:mysql://localhost:3306/test"
      maxActive="4"/>
  </GlobalNamingResources>

少了这一步会报错:Cannot create JDBC driver of class '' for connect URL 'null'
4)修改web.xml

打开%TOMCAT_HOME%\conf\web.xml或yourwebapp/web-inf/web.xml,添加以下内容:
    <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/mysql</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>

    注意res-ref-name填写的内容要与在上文提到的JNDI Name名称一致。
 到这里,配置工作就基本完成了!

5)引用JNDI时用"java:comp/env/jdbc/mysql";
建立文件测试 test.jsp:
<%@page contentType="text/html;charset=utf-8" %>
<%@page import="java.sql.*" %>
<%@page import="javax.sql.*" %>
<%@page import="javax.naming.*" %>
<html>
<head>
<title>Tomcat连接池测试</title>
</head>
<body>
<%
  Context ctx=new InitialContext();
  Connection conn=null;
  DataSource ds=(DataSource)ctx.lookup("java:comp/env/jdbc/mysql");
  conn=ds.getConnection();
  Statement stmt=conn.createStatement(ResultSet.CONCUR_READ_ONLY,ResultSet.CONCUR_UPDATABLE);
  ResultSet rs=stmt.executeQuery("select * from testexample");
  while(rs.next()){
  out.println(rs.getInt(1));
  out.println(rs.getString(2));
  out.println(rs.getString(3));
  }
  out.println("数据库操作成功!");
  rs.close();
  stmt.close();
  conn.close();
   
 %>
</body>
</html>




 

Feedback

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2007-08-31 09:30 by 齐波
谢谢你的方法哈,顶起!!!

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')[未登录]  回复  更多评论   

2007-11-28 17:06 by liu
ctx.lookup("java:comp/env/jdbc/mysql");
什么意思,我的程序老是在这报错

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2007-11-28 20:15 by flustar
@liu
把错误信息贴出来!~

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-01-24 20:35 by tq04q5k
全靠阁下了,我弄了整整一周了!

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-03-20 10:38 by 试试
我试一下。

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')[未登录]  回复  更多评论   

2008-04-21 21:39 by Daisy
按照你的方法还是出现Cannot create JDBC driver of class '' for connect URL 'null'


55555为什么??

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')[未登录]  回复  更多评论   

2008-04-21 21:59 by flustar
@Daisy
请再检查一下你的Tomcat版本,并确定你是否按照我的这个步骤配置的?把你的错误日志发给我,我帮你看一下。

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-04-25 15:06 by w2j3z3j2h1
你那方法还是不行啊,我只要登录的话,tomcat 马上就出错,错误日志如下:
麻烦老兄看下啊,还有你“JNDI Name: ->jdbc/mysql”这个地方一定是这样吗?可不可以是“JNDI Name: ->jdbc/mydb”啊,谢谢!
2008-4-25 14:58:45 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2008-4-25 14:58:45 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2008-4-25 14:58:45 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2008-4-25 14:58:45 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2008-4-25 14:58:45 org.apache.catalina.core.ApplicationContext log
信息: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
2008-4-25 14:59:30 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at com.bjsxt.drp.sysmgr.UserManager.findUserById(UserManager.java:86)
at com.bjsxt.drp.sysmgr.UserManager.login(UserManager.java:244)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:55)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.bjsxt.drp.util.filter.IpFilter.doFilter(IpFilter.java:30)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at com.bjsxt.drp.util.filter.CharsetEncodingFilter.doFilter(CharsetEncodingFilter.java:32)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:619)

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-04-27 00:10 by flustar
@w2j3z3j2h1
java.lang.NullPointerException 说明你引用了一个null值,再看一下UserManager.findUserById方法,建议你直接写一个简单的程序测一下。
jndi名称可以是jdbc/mydb的,但是在使用的时候要ctx.lookup("java:comp/env/jdbc/mydb");

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-06-16 20:54 by billschen

仔细阅读自己机子上的Tomcat帮助文啦.按它的来做就行了.

http://127.0.0.1:8080/tomcat-docs/jndi-datasource-examples-howto.html

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-08-04 23:12 by 风之类
我的问题解决了,还真得谢谢 大师!
问一下这 org.gjt.mm.mysql.Driver 是哪个厂商的驱动啊?

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-08-08 14:39 by
很感谢,找了好久终于在你这得到了解决!!!!!!

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-08-22 08:24 by 谢谢
太感动了
这个问题折磨了我整整两天(每天花十个钟来弄)
一切尽在不言中,总之,我太爱你了,好想亲你一口啊!

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-08-25 14:11 by ff
修改\conf\Catalina\localhost目录下建立一个xml文件,名称为你所发布的web应用的名称.xml,(如testpool.xml)打开添加内容如下:

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-08-25 14:12 by ff
修改\conf\Catalina\localhost目录下建立一个xml文件,名称为你所发布的web应用的名称.xml,(如testpool.xml)打开添加内容如下:

这里的名称,是不是项目名称啊?还是

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2008-09-05 14:07 by pf
其实只需要在\conf\Catalina\localhost下建个和web应用名一样的xml就可以了,conf下的server.xml根本不用修改也好使 ,我试过了

\conf\Catalina\localhost下 应用名.xml是这个应用所私有的,别的项目不能使用。而server.xml则是公有的

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')[未登录]  回复  更多评论   

2008-09-17 17:28 by flying
我按照你的方法做了,可是还是不对啊,我用的是sql server2000的数据库
我设置的在修改\conf\Catalina\localhost目录下建立一个xml文件,我做了一个留言板的测试,在上面的目录下建了叫guestbook.xml的文件,内容入下:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource
name="jdbc/sqlserver "
type="javax.sql.DataSource"
maxActive="20"
maxIdle="10"
username="sa"
maxWait="5000"
driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
password="123456"
url="jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=guestbook" />

</Context>
出错的信息:
2008-9-17 17:21:50 org.apache.struts.chain.ComposableRequestProcessor init
信息: Initializing composable request processor for module prefix ''
2008-9-17 17:21:50 org.apache.struts.chain.commands.servlet.CreateAction createAction
信息: Initialize action of type: com.guestbook.web.action.InputAction
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.apache.commons.dbutils.QueryRunner.prepareConnection(QueryRunner.java:195)
at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:481)
at com.guestbook.web.action.InputAction.execute(InputAction.java:62)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
at java.sql.DriverManager.getDriver(DriverManager.java:253)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
... 27 more

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')[未登录]  回复  更多评论   

2008-09-17 17:29 by flying
希望楼主的解答,谢谢

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')[未登录]  回复  更多评论   

2008-09-17 17:47 by flying
用楼主给的测试例子出下面的错误:
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at sun.jdbc.odbc.JdbcOdbcDriver.getProtocol(JdbcOdbcDriver.java:507)
at sun.jdbc.odbc.JdbcOdbcDriver.knownURL(JdbcOdbcDriver.java:476)
at sun.jdbc.odbc.JdbcOdbcDriver.acceptsURL(JdbcOdbcDriver.java:307)
at java.sql.DriverManager.getDriver(DriverManager.java:253)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.apache.jsp.test_jsp._jspService(test_jsp.java:58)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:834)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:640)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)
at java.lang.Thread.run(Thread.java:619)

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2009-01-25 13:15 by 邹跃丰
Server startup in 2969 ms
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:780)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at org.sunxin.ch04.servlet.GetDBInfoServlet.doGet(GetDBInfoServlet.java:27)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(Unknown Source)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:773)
... 18 more

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2009-03-19 00:47 by zhengxw
我按你的方法做了,但浏览器一直处于正在连接,没变化啊,还是连不上啊,谢谢知道啊

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2009-05-12 16:10 by 小新
@liu
读取jidn 的

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2009-06-02 12:36 by claram
楼主谢谢啊

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2009-08-12 11:28 by 追风小子
非常的感谢楼主分享 用你的方法终于配置成功啦 而且是Tomcat 6.0

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2010-04-14 21:53 by 张鹏飞
H还是不行呀 博主 我的qq是362158294 我想和你联系一下

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2010-06-30 11:59 by 何琴琴
太谢谢了,太多的方法,我都试了,但还是在你这个帮我解决了。

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2011-05-21 13:20 by 小麦
严重: End event threw exception
java.lang.reflect.InvocationTargetException
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:597)
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1567)
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Caused by: java.lang.IllegalArgumentException: Context path is required
at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:890)
... 38 more
2011-5-21 13:21:55 org.apache.catalina.startup.HostConfig deployDescriptors
严重: Error deploying configuration descriptor dorm.xml
java.io.IOException: java.lang.IllegalArgumentException: Context path is required
at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:494)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

# re: 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')  回复  更多评论   

2013-05-02 10:58 by bella
设置的在修改\conf\Catalina\localhost目录下建立一个xml文件,将conf/server.xml中关于项目的<Context> ......</Context>
删掉,我就只是这样改了一下就好了

只有注册用户登录后才能发表评论。


网站导航:
 

posts - 146, comments - 143, trackbacks - 0, articles - 0

Copyright © flustar