public JSONObject Login(JSONObject jsonObj) throws BusinessException {
// 登录功能
// 接收三个参数:adminid 管理员名、adminPass 管理员密码、captcha 验证码
JSONObject result = new JSONObject();
MD5 md = new MD5();
String id = jsonObj.getString("member_id");
String pwd = jsonObj.getString("pwd");
String sql = "select pwd,salt from admin_table where member_id=?";
mysql.OPenDb(DBMysql.DB_TYPE_MASTER);// 选择主库进行read
Object[] params = { id };
Admin admin = mysql.query(Admin.class, sql, params);
// database pwd=md5(md5(request pwd)+database salt))
String pwlt = md.Encode(md.Encode(pwd) + admin.getSalt());
try {
if (pwlt.equals(admin.getPwd())) {
result.element("code", InterfaceErrorCode.NO_ERROR).element(
"info", InterfaceErrorInfo.NO_ERROR);
req.getSession().setAttribute("admin", admin);
}
} catch (Exception e) {
result.element("info", BusinessException.Translate(e.getMessage()));
e.printStackTrace();
}
mysql.close();
return result;
}
/**
* 释放资源
*/
public void close() {
try {
if (this.rs != null)
this.rs.close();
} catch (Exception e) {
e.printStackTrace();
}
try {
if (this.conn != null)
this.conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
一月 17, 2018 11:13:16 上午 com.alibaba.druid.pool.DruidDataSource error
严重: abandon connection, owner thread: http-apr-8080-exec-3, connected at : 1516158436474, open stackTrace
at java.lang.Thread.getStackTrace(Thread.java:1589)
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:1068)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4544)
at com.alibaba.druid.filter.FilterAdapter.dataSource_getConnection(FilterAdapter.java:2723)
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4540)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:992)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:984)
at LMPack.Tools.Database.DBMysql.getMasterConnection(DBMysql.java:69)
at LMPack.Tools.Database.DBMysql.OPenDb(DBMysql.java:111)
at LMPack.Service.Restful.IEnterance.wwoTest(IEnterance.java:154)
at LMPack.Service.Restful.IEnterance$FM$wwoTest$4e8cf7a5f1235d40ec6785e1e6bddfad.invoke(IEnterance.java)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:30)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2555)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2544)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
ownerThread current state is WAITING, current stackTrace
at sun.misc.Unsafe.park(Native Method)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104)
at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
=====================================================
这是properties
removeAbandoned:true
removeAbandonedTimeout:1800
logAbandoned:true
@wendal