tomcat 5.5 Cannot create JDBC driver of class '' for connect URL 'null' 配置数据源错误解决办法

简介:

使用如下:在conf/Catalina/localhost下新增与项目同名的配置文件

 

bbs.xml

 

<?xml version='1.0' encoding='utf-8'?>
<Context displayName="web" docBase="E:/work/bbstest/WebRoot" path="/bbs" workDir="E:/work/bbstest/WebRoot">
<Resource name="jdbc/bbs" type="javax.sql.DataSource" password="root" driverClassName="com.mysql.jdbc.Driver" maxIdle="2" maxWait="5000" username="root" url="jdbc:mysql://localhost:3306/bbs?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=GB2312" maxActive="100"/>

</Context>

 

testdb.xml

 

<?xml version='1.0' encoding='utf-8'?>
<Context displayName="testdb" docBase="E:/vmware/apache-tomcat-5.5.29/testdb" path="/testdb" workDir="E:/vmware/apache-tomcat-5.5.29/testdb">
<Resource name="jdbc/E5NEW" type="javax.sql.DataSource" password="root" driverClassName="com.mysql.jdbc.Driver" maxIdle="2" maxWait="5000" username="root" url="jdbc:mysql://localhost:3306/testdb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8" maxActive="100"/>

</Context>

 

 

只要配置这个即可。web.xml不需要配置。

 

相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。 &nbsp; 相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情:&nbsp;https://www.aliyun.com/product/rds/mysql&nbsp;
目录
相关文章
|
应用服务中间件
关于tomcat程序不支持图形化的解决办法
关于tomcat程序不支持图形化的解决办法
383 0
|
应用服务中间件
解决tomcat无法启动显示cannot touch
解决tomcat无法启动显示cannot touch
609 1
|
应用服务中间件 Android开发
Eclipse启动tomcat项目乱码而终端启动tomcat正常的解决办法
Eclipse启动tomcat项目乱码而终端启动tomcat正常的解决办法
405 0
|
JavaScript 前端开发 API
使用ort.js的create方法加载onnx模型报错:Fetch API cannot load file…… URL scheme “file“ is not supported.
使用ort.js的create方法加载onnx模型报错:Fetch API cannot load file…… URL scheme “file“ is not supported.
1037 0
使用ort.js的create方法加载onnx模型报错:Fetch API cannot load file…… URL scheme “file“ is not supported.
Error: Cannot find module ‘node:url‘【已解决】
Error: Cannot find module ‘node:url‘【已解决】
1538 3
|
缓存 JavaScript
报错:cannot read properties of undefined “reading url“
报错:cannot read properties of undefined “reading url“
683 6
|
Java 应用服务中间件
解决tomcat启动报错:无法在web.xml或使用此应用程序部署的jar文件中解析绝对的url [http:java.sun.com/jsp/jstl/core]
解决tomcat启动报错:无法在web.xml或使用此应用程序部署的jar文件中解析绝对的url [http:java.sun.com/jsp/jstl/core]
3416 1
|
监控 druid Java
Springboot用JUnit测试接口时报错Failed to determine a suitable driver class configure a DataSource: ‘url‘
Springboot用JUnit测试接口时报错Failed to determine a suitable driver class configure a DataSource: ‘url‘
811 0
|
存储 应用服务中间件 Docker
Docker容器无法启动Cannot find /usr/local/tomcat/bin/setclasspath.sh
根据具体情况,你可以尝试以上方法中的一个或多个,以解决 "Cannot find /usr/local/tomcat/bin/setclasspath.sh" 的问题。确保你的Docker容器中包含了完整且正确配置的Tomcat,并且相关文件和目录的权限设置正确。
1102 0
|
SQL 安全 Java
6. 成功解决:Driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver' could not be found, make sure the 'MS SQL Server (Native)' driver (jar file) is installed.
在使用 Kettle(Spoon) 工具创建 SQL Server 数据库连接时,提示:Driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver' could not be found, make sure the 'MS SQL Server (Native)' driver (jar file) is installed. com.microsoft.sqlserver.jdbc.SQLServerDriver
2833 1

热门文章

最新文章