应用程序部署在tomcat 8上,甚至可以打开已部署的WAR文件的URL。但是只要我在context.xml中添加资源详细信息并退回服务器,服务器就不会出现,我在点击URL时得到HTTP 404。(在tomcat 7的context.xml中添加相同的工作正常)<登记/> 以下是context.xml中添加的部分
<Resource name="jdbc/ace" auth="Container" type="javax.sql.DataSource"
initialSize="5" maxTotal="20" maxIdle="1000" maxWaitMillis="30000"
username="Username" password="password"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@myservername.com:1521:DB_Alias" />
以下是我得到的错误(使用tomcat包附带的默认web.xml):
04-May-2016 05:17:05.589 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.32
04-May-2016 05:17:05.716 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /opt/tomcat/apache_tomcat-8.0.32/apache-tomcat-8.0.32/webapps/RD.war
04-May-2016 05:17:21.116 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ RD]] 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) 在org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) 在org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) 在org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) 在org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939) 在org.apache.catalina.startup.HostConfig $ DeployWar.run(HostConfig.java:1812) at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:471) 在java.util.concurrent.FutureTask.run(FutureTask.java:262) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615) 在java.lang.Thread.run(Thread.java:745) 引起:java.lang.AbstractMethodError:oracle.jdbc.driver.T4CConnection.isValid(I)Z at org.apache.tomcat.dbcp.dbcp2.DelegatingConnection.isValid(DelegatingConnection.java:917) at org.apache.tomcat.dbcp.dbcp2.PoolableConnection.validate(PoolableConnection.java:282) at org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.validateConnection(PoolableConnectionFactory.java:356) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2306) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2289) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2038) at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getLogWriter(BasicDataSource.java:1587) at org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory.createDataSource(BasicDataSourceFactory.java:594) at org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory.getObjectInstance(BasicDataSourceFactory.java:274) at org.apache.naming.factory.FactoryBase.getObjectInstance(FactoryBase.java:94) 在javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321) 在org.apache.naming.NamingContext.lookup(NamingContext.java:841) 在org.apache.naming.NamingContext.lookup(NamingContext.java:152) at org.apache.naming.NamingContext.lookup(NamingContext.java:829) 在org.apache.naming.NamingContext.lookup(NamingContext.java:166) 在org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1084) at org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:663) 在org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:256) 在org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95) 在org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) 在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154) 在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) ......还有10个
04-May-2016 05:17:21.133严重[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR部署Web应用程序存档时出错/opt/tomcat/apache_tomcat-8.0.32/apache- Tomcat的8.0.32 / web应用/ RD.war java.lang.IllegalStateException:ContainerBase.addChild:start:org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/ RD]] 在org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:729) 在org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) 在org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) 在org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:939) 在org.apache.catalina.startup.HostConfig $ DeployWar.run(HostConfig.java:1812) at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:471)