问题描述
- Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
-
以前写的代码没有问题,现在在新的机器上部署就报错:
2013-10-8 22:36:17 org.apache.catalina.core.StandardHostDeployer install
信息: Installing web application at context path /NetCTOSS_V3 from URL file:E:Tomcat 5.0webappsNetCTOSS_V3
ERROR - Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
2013-10-8 22:36:28 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2013-10-8 22:36:28 org.apache.catalina.core.StandardContext start
严重: Context startup failed due to previous errors
jar包也不缺啊。。tomcat下的servlet-api.jar也在。实在不知道什么原因了。求大家帮帮忙,不胜感激。我也在试探中。(看过有的资料说是eclipse的bug,搞不懂。自己感觉像spring配置文件的问题,还不敢确定,下面是配置文件内容)
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><!--指定Spring配置文件位置和名称 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/applicationContext.xml</param-value> </context-param> <!--服务器启动时,实例化Spring容器对象 --> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!--添加openSessionInViewFilter --> <filter> <filter-name>openSessionInViewFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> </filter> <filter-mapping> <filter-name>openSessionInViewFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>Struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class> </filter> <filter-mapping> <filter-name>Struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
解决方案
你在tomcat/lib路径下面添加了包吗
时间: 2025-01-20 10:59:57