DBCP object created 2013-04-28 00:03:53 by the following code was never closed

weixin_38072180 weixin_38072180 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
部署在tomcat下的一个工程,工程里面的default.js调用了一个sc.jsp,后台日志时不时的就会报错,有哪位大神能不能帮偶看看问题出在哪哇 org.apache.tomcat.dbcp.dbcp.AbandonedTrace$AbandonedObjectException: DBCP object created 2013-04-28 00:03:53 by the following code was never closed: 详细的报错代码如下: org.apache.tomcat.dbcp.dbcp.AbandonedTrace$AbandonedObjectException: DBCP object created 2013-04-28 00:03:53 by the following code was never closed: at org.apache.tomcat.dbcp.dbcp.AbandonedTrace.setStackTrace(AbandonedTrace.java:139) at org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:81) at org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.apache.jsp.sc_jsp.getConnection(sc_jsp.java:35) at org.apache.jsp.sc_jsp.countbytitle(sc_jsp.java:45) at org.apache.jsp.sc_jsp._jspService(sc_jsp.java:173) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1771) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) function countbytitle(titleurl){ var url = "http://localhost:8080/helpsearch/sc.jsp?q=" + cjkEncode(titleurl); var js_obj = document.createElement("script"); js_obj.type = "text/javascript"; js_obj.setAttribute("src",url); document.body.appendChild(js_obj); }; sc.jsp代码如下: <%@ page language="java" contentType="application/x-javascript; charset=utf-8"%> <%@ page import="java.io.File" %> <%@ page import="java.sql.Connection" %> <%@ page import="java.sql.DriverManager" %> <%@ page import="java.sql.ResultSet" %> <%@ page import="java.sql.Statement" %> <%@ page import="java.sql.Connection" %> <%@ page import="java.sql.ResultSet" %> <%@ page import="java.sql.Statement" %> <%@ page import="javax.naming.Context" %> <%@ page import="javax.naming.InitialContext" %> <%@ page import="javax.sql.DataSource" %> <%! public static Connection getConnection() { Connection conn = null; try { Context context = new InitialContext(); DataSource datasource = (DataSource) context.lookup("java:comp/env/jdbc/mysql"); conn = datasource.getConnection(); } catch (Exception e) { e.printStackTrace(); } return conn; } private static String countbytitle(String titleurl) throws Exception{ StringBuffer data = new StringBuffer("["); //int yesnum = 25; //int nonum = 30; Connection conn = getConnection(); Statement st = conn.createStatement(); ResultSet rs = null; String sqlyes = ""; String sqlno = ""; int yesnum = 0; int nonum = 0; sqlyes = "SELECT count(*) FROM doc_solveproblem WHERE doctitle = '"+titleurl+"' AND 703solveproblem = 'yes'"; rs = st.executeQuery(sqlyes); if (rs.next()) { yesnum = rs.getInt(1); } sqlno = "SELECT count(*) FROM doc_solveproblem WHERE doctitle = '"+titleurl+"' AND 703solveproblem = 'no'"; rs = st.executeQuery(sqlno); if (rs.next()) { nonum = rs.getInt(1); } data.append("\""); data.append(yesnum + "\","); data.append("\""); data.append(nonum + "\""); st.close(); conn.close(); data.append("]"); System.out.println(yesnum); System.out.println(nonum); return data.toString(); } private static String cjkDecode(String text) throws Exception { if (text == null) { return ""; } //查找没有 "[", 直接返回. if (text.indexOf('[') == -1) { return text; } StringBuffer newTextBuf = new StringBuffer(); for (int i = 0; i < text.length(); i++) { char ch = text.charAt(i); if (ch == '[') { int rightIdx = text.indexOf(']', i + 1); if (rightIdx > i + 1) { String subText = text.substring(i + 1, rightIdx); //james:主要是考虑[CDATA[]]这样的值的出现 if (subText.length() > 0) { ch = (char) Integer.parseInt(subText, 16); } i = rightIdx; } } newTextBuf.append(ch); } return newTextBuf.toString(); } %> <% String titleurl = cjkDecode(request.getParameter("q")); String data = "[]"; try { data = countbytitle(titleurl); } catch (Exception e) { e.printStackTrace(); } response.getWriter().print("var data = " + data + ";"); response.getWriter().print("var titleurl = '" + titleurl + "';"); response.getWriter().print("test(titleurl, data);"); %>
...全文

相关推荐

commons-dbcp-1.4-src&commons-pool-1.5.4-src

commons-pool-1.5.4 RELEASE NOTES This is a patch release containing a fix for POOL-152, a regression introduced in version 1.5. Changes in this version include: Fixed Bugs: o POOL-152: GenericObjectPool can block forever in borrowObject when the pool is exhausted and a newly created object fails validation. When borrowing an object if a new object is created but validate fails, the latch should not be returned to the queue as an exception will be thrown. Thanks to Bushov Alexander. For complete information on commons-pool, including instructions on how to submit bug reports, patches, or suggestions for improvement, see the commons-pool website: http://commons.apache.org/pool/

lingshihua123456

tomcat-8_API

================================================================================ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================================================ Apache Tomcat Version 8.0.15 Release Notes ========= CONTENTS: ========= * Dependency Changes * API Stability * Bundled APIs * Web application reloading and static fields in shared libraries * Security manager URLs * Symlinking static resources * Viewing the Tomcat Change Log * Cryptographic software notice * When all else fails =================== Dependency Changes: =================== Tomcat 8.0 is designed to run on Java SE 7 and later. ============== API Stability: ============== The public interfaces for the following classes are fixed and will not be changed at all during the remaining lifetime of the 8.x series: - All classes in the javax namespace The public interfaces for the following classes may be added to in order to resolve bugs and/or add new features. No existing interface method will be removed or changed although it may be deprecated. - org.apache.catalina.* (excluding sub-packages) Note: As Tomcat 8 matures, the above list will be added to. The list is not c

「已注销」

tomcat-7_API_帮助文档

================================================================================ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================================================ Apache Tomcat Version 7.0.57 Release Notes ========= CONTENTS: ========= * Dependency Changes * API Stability * JNI Based Applications * Bundled APIs * Web application reloading and static fields in shared libraries * Tomcat on Linux * Enabling SSI and CGI Support * Security manager URLs * Symlinking static resources * Viewing the Tomcat Change Log * Cryptographic software notice * When all else fails =================== Dependency Changes: =================== Tomcat 7.0 is designed to run on Java SE 6 and later. In addition, Tomcat 7.0 uses the Eclipse JDT Java compiler for compiling JSP pages. This means you no longer need to have the complete Java Development Kit (JDK) to run Tomcat, but a Java Runtime Environment (JRE) is sufficient. The Eclipse JDT Java compiler is bundled with the binary Tomcat distributions. Tomcat can also be configured to use the compiler from the JDK to compile JSPs, or any other Java compiler supported by Apache Ant. ============== API Stability: ============== The public interfaces for the following classes are fixed and will not be changed at all during the remaining lifetime of the 7.x series: - javax/**/* The public interfaces for the following classes may be added to in order to resolve bugs and/or add new features. No existing interface will be removed or changed although it may be deprecated. - org/apache/catalina/* - org/apache/catalina/comet/* Note: As Tomcat 7 matures, the above list will be added to. The list is not considered complete at this time. The remaining classes are considered part of the Tomcat internals and may change without notice between point releases. ======================= JNI Based Applications: ======================= Applications that require native libraries must ensure that the libraries have been loaded prior to use. Typically, this is done with a call like: static { System.loadLibrary("path-to-library-file"); } in some class. However, the application must also ensure that the library is not loaded more than once. If the above code were placed in a class inside the web application (i.e. under /WEB-INF/classes or /WEB-INF/lib), and the application were reloaded, the loadLibrary() call would be attempted a second time. To avoid this problem, place classes that load native libraries outside of the web application, and ensure that the loadLibrary() call is executed only once during the lifetime of a particular JVM. ============= Bundled APIs: ============= A standard installation of Tomcat 7.0 makes all of the following APIs available for use by web applications (by placing them in "lib"): * annotations-api.jar (Annotations package) * catalina.jar (Tomcat Catalina implementation) * catalina-ant.jar (Tomcat Catalina Ant tasks) * catalina-ha.jar (High availability package) * catalina-tribes.jar (Group communication) * ecj-4.4.jar (Eclipse JDT Java compiler) * el-api.jar (EL 2.2 API) * jasper.jar (Jasper 2 Compiler and Runtime) * jasper-el.jar (Jasper 2 EL implementation) * jsp-api.jar (JSP 2.2 API) * servlet-api.jar (Servlet 3.0 API) * tomcat7-websocket.jar (WebSocket 1.1 implementation) * tomcat-api.jar (Interfaces shared by Catalina and Jasper) * tomcat-coyote.jar (Tomcat connectors and utility classes) * tomcat-dbcp.jar (package renamed database connection pool based on Commons DBCP) * tomcat-jdbc.jar (Tomcat's database connection pooling solution) * tomcat-util.jar (Various utilities) * websocket-api.jar (WebSocket 1.1 API) You can make additional APIs available to all of your web applications by putting unpacked classes into a "classes" directory (not created by default), or by placing them in JAR files in the "lib" directory. To override the XML parser implementation or interfaces, use the endorsed mechanism of the JVM. The default configuration defines JARs located in "endorsed" as endorsed. ================================================================ Web application reloading and static fields in shared libraries: ================================================================ Some shared libraries (many are part of the JDK) keep references to objects instantiated by the web application. To avoid class loading related problems (ClassCastExceptions, messages indicating that the classloader is stopped, etc.), the shared libraries state should be reinitialized. Something which might help is to avoid putting classes which would be referenced by a shared static field in the web application classloader, and putting them in the shared classloader instead (JARs should be put in the "lib" folder, and classes should be put in the "classes" folder). ================ Tomcat on Linux: ================ GLIBC 2.2 / Linux 2.4 users should define an environment variable: export LD_ASSUME_KERNEL=2.2.5 Redhat Linux 9.0 users should use the following setting to avoid stability problems: export LD_ASSUME_KERNEL=2.4.1 There are some Linux bugs reported against the NIO sendfile behavior, make sure you have a JDK that is up to date, or disable sendfile behavior in the Connector.<br/> 6427312: (fc) FileChannel.transferTo() throws IOException "system call interrupted"<br/> 5103988: (fc) FileChannel.transferTo should return -1 for EAGAIN instead throws IOException<br/> 6253145: (fc) FileChannel.transferTo on Linux fails when going beyond 2GB boundary<br/> 6470086: (fc) FileChannel.transferTo(2147483647, 1, channel) cause "Value too large" exception<br/> ============================= Enabling SSI and CGI Support: ============================= Because of the security risks associated with CGI and SSI available to web applications, these features are disabled by default. To enable and configure CGI support, please see the cgi-howto.html page. To enable and configue SSI support, please see the ssi-howto.html page. ====================== Security manager URLs: ====================== In order to grant security permissions to JARs located inside the web application repository, use URLs of of the following format in your policy file: file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar ============================ Symlinking static resources: ============================ By default, Unix symlinks will not work when used in a web application to link resources located outside the web application root directory. This behavior is optional, and the "allowLinking" flag may be used to disable the check. ============================== Viewing the Tomcat Change Log: ============================== See changelog.html in this directory. ============================= Cryptographic software notice ============================= This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See <http://www.wassenaar.org/> for more information. The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code. The following provides more details on the included cryptographic software: - Tomcat includes code designed to work with JSSE - Tomcat includes code designed to work with OpenSSL ==================== When all else fails: ==================== See the FAQ http://tomcat.apache.org/faq/

「已注销」

MySQLConnection:用java语言编程连接MySQL

MySQL连接 该程序的概念是与 php 文件通信,然后是与 MySQL 通信的 php 文件:p

吉莫吉鱼

java_mysql.zip_java连接mysql

介绍 Java 如何使用 使用 JDBC 连接 MySQL 数据库。

alvarocfc
评论 1
收藏 已收藏
分享
返回顶部