问题描述
Tomcat部署出现这问题,如何解决首先,说明下:这个项目直接用eclipse可以直接运行,数据源用plsql连接可以连接的上其次:不管我将oracle里面.jdcb里面的驱动jar放置在tomcat/lib下,还是不放置,都是这个问题再次:tomcat使用的是7.0严重:Exceptionsendingcontextinitializedeventtolistenerinstanceofclasscom.funo.listener.SpringContextLoaderorg.springframework.jdbc.CannotGetJdbcConnectionException:CouldnotgetJDBCConnection;nestedexceptionisorg.apache.tomcat.dbcp.dbcp.SQLNestedException:CannotcreateJDBCdriverofclass'oracle.jdbc.driver.OracleDriver'forconnectURL'jdbc:orajdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.46.51.200)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=10.46.5.202)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=msydb)(FAILOVER_MODE=(TYPE=session)(METHOD=basic)(RETRIES=180)(DELAY=5))))'atorg.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)atorg.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:382)atorg.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:458)atorg.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:466)atorg.springframework.jdbc.core.JdbcTemplate.queryForList(JdbcTemplate.java:497)atcom.funo.dao.LoginDao.findAllComId(LoginDao.java:57)atcom.funo.service.LoginService.findAllComId(LoginService.java:196)atcom.funo.service.LoginService$$FastClassByCGLIB$$5807bf6.invoke(<generated>)atnet.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)atorg.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)atorg.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)atorg.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)atcom.funo.service.LoginService$$EnhancerByCGLIB$$8099c36a.findAllComId(<generated>)atcom.funo.util.SysConstants.init(SysConstants.java:189)atcom.funo.listener.SpringContextLoader.contextInitialized(SpringContextLoader.java:31)atorg.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)atorg.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5490)atorg.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)atorg.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)atorg.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)atorg.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)atorg.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1247)atorg.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1898)atjava.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)atjava.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)atjava.util.concurrent.FutureTask.run(FutureTask.java:138)atjava.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)atjava.lang.Thread.run(Thread.java:662)Causedby:org.apache.tomcat.dbcp.dbcp.SQLNestedException:CannotcreateJDBCdriverofclass'oracle.jdbc.driver.OracleDriver'forconnectURL'jdbc:orajdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.46.51.200)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=10.46.5.202)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=msydb)(FAILOVER_MODE=(TYPE=session)(METHOD=basic)(RETRIES=180)(DELAY=5))))'atorg.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)atorg.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)atorg.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)atorg.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:113)atorg.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)...30moreCausedby:java.sql.SQLException:Nosuitabledriveratorg.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1443)...34more2014-11-2710:38:52org.apache.catalina.core.ApplicationContextlog信息:ClosingSpringrootWebApplicationContext2014-11-2710:38:52org.apache.catalina.core.ApplicationContextlog信息:Shuttingdownlog4j信息:StartingserviceCatalina2014-11-2710:38:38org.apache.catalina.core.StandardEnginestartInternal信息:StartingServletEngine:ApacheTomcat/7.0.552014-11-2710:38:38org.apache.catalina.startup.HostConfigdeployDirectory信息:DeployingwebapplicationdirectoryC:ProgramFilestomcatapache-tomcat-7.0.55webappsIFP2014-11-2710:38:39org.apache.catalina.loader.WebappClassLoadervalidateJarFile信息:validateJarFile(C:ProgramFilestomcatapache-tomcat-7.0.55webappsIFPWEB-INFlibservlet-api.jar)-jarnotloaded.SeeServletSpec3.0,section10.7.2.Offendingclass:javax/servlet/Servlet.class2014-11-2710:38:49org.apache.tomcat.websocket.server.WsScionStartup信息:JSR356WebSocket(JavaWebSocket1.0)supportisnotavailablewhenrunningonJava6.Tosuppressthismessage,runTomcatonJava7,removetheWebSocketJARsfrom$CATALINA_HOME/liboraddtheWebSocketJARstothetomcat.util.scan.DefaultJarScanner.jarsToSkippropertyin$CATALINA_BASE/conf/catalina.properties.NotethatthedeprecatedTomcat7WebSocketAPIwillbeavailable.2014-11-2710:38:52org.apache.catalina.core.StandardContextstartInternal严重:ErrorlistenerStart2014-11-2710:38:52org.apache.catalina.core.StandardContextstartInternal严重:Context[/IFP]startupfailedduetopreviouserrors2014-11-2710:38:52org.apache.catalina.loader.WebappClassLoaderclearReferencesJdbc严重:Thewebapplication[/IFP]registeredtheJDBCdriver[oracle.jdbc.driver.OracleDriver]butfailedtounregisteritwhenthewebapplicationwasstopped.Topreventamemoryleak,theJDBCDriverhasbeenforciblyunregistered.
解决方案
解决方案二:
Oracle我到还没用过。我用的是mysql。我想问的是生产环境和开发环境是同一台机器吗?帐号的权限对不对,密码对不对
解决方案三:
如果使用的是tomcat数据库连接池配置,那么jdbc驱动要放到tomcat的lib目录下面如果是单从工程中去连接数据源,那么驱动jar放到工程的WEB-INF/lib下面就可以了楼主的数据库连接采用的是什么方式呢?可否给一些配置文件或代码出来看看