日期:2014-05-17  浏览次数:20684 次

tomcat6报java.util.NoSuchElementException: Timeout waiting for idle object
context.xml代码如下
XML code

<?xml version="1.0" encoding="UTF-8"?>
<Context>
    <Resource 
        name="jdbc/portal" 
        auth="Container" 
        type="javax.sql.DataSource"
        maxActive="100" 
        maxIdle="50" 
        maxWait="10000" 
                removeAbandoned="true"
                removeAbandonedTimeout="60"
                logAbandoned="true"
        username="ora1" 
        password="ora1" 
        driverClassName="oracle.jdbc.driver.OracleDriver"
        url="jdbc:oracle:thin:@1127.0.0.1:1521:mydb" 
    />
</Context>

报错信息



CSS code

2010-11-17 8:50:20 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.util.NoSuchElementException: Timeout waiting for idle object
    at org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1134)
    at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
    at com.dtp.dao.LaderDAO.getPersonList(LaderDAO.java:20)
    at org.apache.jsp.jsp.query.queryMain_jsp._jspService(queryMain_jsp.java:71)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at com.dtp.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:41)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:619)



------解决方案--------------------
楼主 自己看你的文件本身就有问题

type="javax.sql.DataSource" 这个是mysql用的吧

driverClassName="oracle.jdbc.driver.OracleDriver"