2019-03-10 11:57:22,819 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) DEBUG - Found mapping for [POST] path=/loginadmin : Login.loginadmin(Login.java:186)
2019-03-10 11:57:22,826 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'login'<class cn.Login>
2019-03-10 11:57:22,826 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=login
2019-03-10 11:57:22,826 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(login) in AnnotationIocLoader(packages=[cn, net.wendal.nutzbook])
2019-03-10 11:57:22,826 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'login'<class cn.Login>
2019-03-10 11:57:22,827 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) DEBUG - Load class cn.Login without AOP
2019-03-10 11:57:22,827 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) DEBUG - Save object 'login' to [app]
2019-03-10 11:57:22,843 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'redisService'<class org.nutz.integration.jedis.RedisService>
2019-03-10 11:57:22,843 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - >> Load definition name=redisService
2019-03-10 11:57:22,843 org.nutz.ioc.loader.map.MapLoader.load(MapLoader.java:67) DEBUG - Loading define for name=redisService
2019-03-10 11:57:22,843 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:161) DEBUG - Found IocObject(redisService) in JedisIocLoader@506656640
2019-03-10 11:57:22,843 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209) DEBUG - >> Make...'redisService'<class org.nutz.integration.jedis.RedisService>
2019-03-10 11:57:22,843 org.nutz.ioc.impl.ScopeContext.remove(ScopeContext.java:84) DEBUG - Remove object 'login' from [app]
2019-03-10 11:57:22,843 cn.core.mvc.LogTimeProcessor.process(LogTimeProcessor.java:28) DEBUG - [POST]URI=/xcbm/loginadmin 24ms
2019-03-10 11:57:22,843 org.nutz.mvc.impl.processor.FailProcessor.process(FailProcessor.java:28) WARN - Error@/loginadmin :
org.nutz.ioc.IocException: IocBean[login] throw Exception when creating
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:149)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:116)
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.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.core.mvc.LogTimeProcessor.process(LogTimeProcessor.java:23)
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 cn.core.mvc.MyNutFilter.doFilter(MyNutFilter.java:37)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at cn.core.util.XFilter.doFilter(XFilter.java:25)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: IocBean[login] fail at field=[redisService]
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:135)
... 39 more
Caused by: org.nutz.ioc.IocException: IocBean[redisService] For object [redisService] - type:[class org.nutz.integration.jedis.RedisService]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32)
... 41 more
Caused by: java.lang.NoClassDefFoundError: redis/clients/jedis/GeoUnit
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at org.nutz.ioc.aop.SimpleAopMaker.getInterceptorPairList(SimpleAopMaker.java:112)
at org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:64)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:36)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:210)
... 43 more
Caused by: java.lang.ClassNotFoundException: redis.clients.jedis.GeoUnit
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1343)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1173)
... 50 more
package cn;
import javax.servlet.http.HttpSession;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Filters;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import cn.admin.bean.SysStatus;
import cn.admin.bean.SysUserinfo;
import cn.core.util.BaseModule;
import cn.core.util.ResultBean;
import cn.core.util.XFilter;
import cn.student.bean.Generalrules;
import cn.student.bean.Student;
@IocBean
public class Login extends BaseModule {
@Inject
RedisService redisService;
@At("/loginadmin")
@Ok("json")
@Filters
public Object loginadmin(@Param("userno") String userno, @Param("userpwd") String userpwd) {
ResultBean result = new ResultBean();
SysUserinfo user = null;
try {
user = dao.fetch(SysUserinfo.class, Cnd.where("userno", "=", userno));
if (user == null) {
result.setStatusCode(-1);
result.setStatusMessage("用户编码不正确!");
return result;
}
user = dao.fetch(SysUserinfo.class, Cnd.where("userno", "=", userno).and("userpwd", "=", userpwd));
if (user == null) {
result.setStatusCode(-1);
result.setStatusMessage("用户密码错误!");
return result;
} else {
String sessionid = redisService.get(userno);
HttpSession session = XFilter.requests.get().getSession();
// 强制断掉之前登陆的session
if (null != sessionid) {
HttpSession sess = session.getSessionContext().getSession(sessionid);
sess.invalidate();
}
redisService.set(userno, session.getId());
session.setAttribute("usertype", "admin");
session.setAttribute("user", user);
result.setStatusCode(1);
result.setStatusMessage("登录成功,返回登陆界面!");
super.addSystemLogs("管理员登录", user.getUserno() + user.getUsername() + super.getIpAddr() + "管理员登录成功!");
return result;
}
} catch (Exception e) {
result.setStatusCode(-1);
result.setStatusMessage("登录异常,请稍后再试!");
return result;
}
}
}