67,512
社区成员
发帖
与我相关
我的任务
分享
信息: Deploying web application directory F:\tomcat-8.0\webapps\host-manager
一月 05, 2017 3:17:32 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\tomcat-8.0\webapps\host-manager has finished in 41 ms
一月 05, 2017 3:17:32 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\tomcat-8.0\webapps\manager
一月 05, 2017 3:17:32 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory F:\tomcat-8.0\webapps\manager has finished in 24 ms
一月 05, 2017 3:17:32 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory F:\tomcat-8.0\webapps\ROOT
一月 05, 2017 3:17:33 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
kill 5 ;
kill 6 ;
kill 7 ;
kill 5 ;
kill 6 ;
kill 7 ;
package com.hebeu.util;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class ApplicationListener implements ServletContextListener{
Thread thread = new Thread(new KillConn());
public void contextInitialized(ServletContextEvent sce) {
while (true) {
try {
thread.run();
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
public void contextDestroyed(ServletContextEvent sce) {
}
}
package com.hebeu.util;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
public class KillConn implements Runnable{
public void run() {
String fingSql = "SELECT CONCAT('kill ',id,' ;')'sql' FROM information_schema.`PROCESSLIST` WHERE TIME>10";
ArrayList<String> listSql = new ArrayList<String>();
Connection conn = null;
try {
conn = JDBCUtil.getConn();
conn.setAutoCommit(false);
ResultSet rs = JDBCUtil.findOne(fingSql, conn);
while(rs.next())
{
listSql.add(rs.getString(1));
}
for (String string : listSql) {
System.out.println(string);
// JDBCUtil.doSql(string, conn);
}
conn.commit();
} catch (SQLException e) {
try {
conn.rollback();
} catch (SQLException e1) {
e1.printStackTrace();
}
e.printStackTrace();
}finally{
JDBCUtil.closeAll(null, null, conn);
}
}
}