2018-05-31 10:00
@JFinal
ActiveRecordPlugin 这样配置的!
public void configPlugin(Plugins me) {
// 配置 druid 数据库连接池插件
DruidPlugin druidPlugin = new DruidPlugin(PropKit.get("jdbcUrl"), PropKit.get("user"), PropKit.get("password").trim());
me.add(druidPlugin);
// 配置ActiveRecord插件
ActiveRecordPlugin arp = new ActiveRecordPlugin(druidPlugin);
// 所有映射在 MappingKit 中自动化搞定
_MappingKit.mapping(arp);
me.add(arp);
}
2018-05-31 09:52
@JFinal
[ERROR]-[Thread: http-apr-8080-exec-3]-[com.jfinal.core.ActionHandler.handle()]: /log/loginAction
java.lang.NullPointerException
at com.jfinal.plugin.activerecord.Model.find(Model.java:588)
at com.jfinal.plugin.activerecord.Model.findFirst(Model.java:606)
at com.demo.login.LoginService.getUsername(LoginService.java:15)
at com.demo.login.LoginController.loginAction(LoginController.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.jfinal.aop.Invocation.invoke(Invocation.java:73)
at com.demo.login.LoginInterceptor.intercept(LoginInterceptor.java:8)
at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
at com.jfinal.core.ActionHandler.handle(ActionHandler.java:83)
at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48)
at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
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:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
后台报这种错误!!我SQL加了 limit 1 也是这样!!