model有问题

java.lang.NullPointerException

        at com.jfinal.plugin.activerecord.Model.find(Model.java:457)

        at com.jfinal.plugin.activerecord.Model.findFirst(Model.java:484)

        at org.aish.orm.model.SysUser.getByName(SysUser.java:47)

        at org.aish.admin.controller.IndexController.login(IndexController.java:38)

---------------------------------------------------------------

System.out.println("===IndexController================"+username);

SysUser user = SysUser.dao.getByName(username);显示这行报错jfinal用的1.9

 */

public M findFirst(String sql, Object... paras) {

List<M> result = find(sql, paras);

return result.size() > 0 ? result.get(0) : null;

}


哪里错了???


评论区

JFinal

2016-09-14 16:30

ActiveRecordPlugin 启动没有? me.add(arp) 这行代码没?

zy625080069

2016-09-14 17:30

@JFinal SysUser user = dao.findFirst("select * from sys_user where username=?", username);这行有问题不知道为什么有问题

zy625080069

2016-09-14 17:31

java.lang.NullPointerException

at com.jfinal.plugin.activerecord.Model.find(Model.java:457)

at com.jfinal.plugin.activerecord.Model.findFirst(Model.java:484)

at org.aish.orm.model.SysUser.getByName(SysUser.java:47)

at org.aish.admin.controller.IndexController.login(IndexController.java:38)

Wangzhen8

2019-11-13 17:41

java.lang.NullPointerException: null
at com.jfinal.plugin.activerecord.Model.find(Model.java:692)
at io.jboot.db.model.JbootModel.find(JbootModel.java:577)
at com.jfinal.plugin.activerecord.Model.find(Model.java:703)
at com.jfinal.plugin.activerecord.Model.findFirst(Model.java:726)
at com.dbumama.market.service.provider.AuthUserServiceImpl.getAuthUserByAppId(AuthUserServiceImpl.java:607)
at com.dbumama.market.service.provider.AuthUserServiceImpl$$EnhancerByCGLIB$$49d01780.CGLIB$getAuthUserByAppId$18()
at com.dbumama.market.service.provider.AuthUserServiceImpl$$EnhancerByCGLIB$$49d01780$$FastClassByCGLIB$$af0feca1.invoke()
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at com.jfinal.ext.proxy.CglibCallback.lambda$intercept$0(CglibCallback.java:58)
at com.jfinal.aop.Invocation.invoke(Invocation.java:101)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:61)
at io.jboot.components.limiter.LimiterInterceptor.intercept(LimiterInterceptor.java:50)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCacheInterceptor.intercept(JbootCacheInterceptor.java:44)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCachePutInterceptor.intercept(JbootCachePutInterceptor.java:35)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCachesEvictInterceptor.intercept(JbootCachesEvictInterceptor.java:43)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCacheEvictInterceptor.intercept(JbootCacheEvictInterceptor.java:37)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.support.metric.JbootMetricInterceptor.intercept(JbootMetricInterceptor.java:43)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at com.dbumama.market.aop.WeappAopInterceptor.intercept(WeappAopInterceptor.java:11)
at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
at com.jfinal.ext.proxy.CglibCallback.intercept(CglibCallback.java:63)
at com.dbumama.market.service.provider.AuthUserServiceImpl$$EnhancerByCGLIB$$49d01780.getAuthUserByAppId()
at com.alibaba.dubbo.common.bytecode.Wrapper14.invokeMethod(Wrapper14.java)
at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)
at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76)
at com.alibaba.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:52)
at io.jboot.support.seata.filter.TransactionPropagationFilter.invoke(TransactionPropagationFilter.java:41)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:73)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:138)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:104)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:173)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
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)

JFinal-4.7 action report -------- 2019-11-13 17:38:48 --------------------------
Url : GET /login
Controller : com.dbumama.market.web.controller.IndexController.(IndexController.java:1)
Method : login
Interceptor : com.dbumama.market.web.core.interceptor.Wxm18nInterceptor.(Wxm18nInterceptor.java:1)
com.jfinal.ext.interceptor.SessionInViewInterceptor.(SessionInViewInterceptor.java:1)
com.dbumama.market.web.core.interceptor.CSRFInterceptor.(CSRFInterceptor.java:1)

Wangzhen8

2019-11-13 17:41

java.lang.NullPointerException: null
at com.jfinal.plugin.activerecord.Model.find(Model.java:692)
at io.jboot.db.model.JbootModel.find(JbootModel.java:577)
at com.jfinal.plugin.activerecord.Model.find(Model.java:703)
at com.jfinal.plugin.activerecord.Model.findFirst(Model.java:726)
at com.dbumama.market.service.provider.AuthUserServiceImpl.getAuthUserByAppId(AuthUserServiceImpl.java:607)
at com.dbumama.market.service.provider.AuthUserServiceImpl$$EnhancerByCGLIB$$49d01780.CGLIB$getAuthUserByAppId$18()
at com.dbumama.market.service.provider.AuthUserServiceImpl$$EnhancerByCGLIB$$49d01780$$FastClassByCGLIB$$af0feca1.invoke()
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at com.jfinal.ext.proxy.CglibCallback.lambda$intercept$0(CglibCallback.java:58)
at com.jfinal.aop.Invocation.invoke(Invocation.java:101)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:61)
at io.jboot.components.limiter.LimiterInterceptor.intercept(LimiterInterceptor.java:50)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCacheInterceptor.intercept(JbootCacheInterceptor.java:44)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCachePutInterceptor.intercept(JbootCachePutInterceptor.java:35)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCachesEvictInterceptor.intercept(JbootCachesEvictInterceptor.java:43)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCacheEvictInterceptor.intercept(JbootCacheEvictInterceptor.java:37)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.support.metric.JbootMetricInterceptor.intercept(JbootMetricInterceptor.java:43)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at com.dbumama.market.aop.WeappAopInterceptor.intercept(WeappAopInterceptor.java:11)
at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
at com.jfinal.ext.proxy.CglibCallback.intercept(CglibCallback.java:63)
at com.dbumama.market.service.provider.AuthUserServiceImpl$$EnhancerByCGLIB$$49d01780.getAuthUserByAppId()
at com.alibaba.dubbo.common.bytecode.Wrapper14.invokeMethod(Wrapper14.java)
at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)
at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76)
at com.alibaba.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:52)
at io.jboot.support.seata.filter.TransactionPropagationFilter.invoke(TransactionPropagationFilter.java:41)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:73)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:138)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:104)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:173)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
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)

Wangzhen8

2019-11-13 17:42

java.lang.NullPointerException
at com.jfinal.plugin.activerecord.Model.find(Model.java:692)
at io.jboot.db.model.JbootModel.find(JbootModel.java:577)
at com.jfinal.plugin.activerecord.Model.find(Model.java:703)
at com.jfinal.plugin.activerecord.Model.find(Model.java:710)
at com.dbumama.market.service.provider.MenuServiceImpl.getMenus(MenuServiceImpl.java:174)
at com.dbumama.market.service.provider.MenuServiceImpl.getFwMenus(MenuServiceImpl.java:239)
at com.dbumama.market.service.provider.MenuServiceImpl$$EnhancerByCGLIB$$72f696bc.CGLIB$getFwMenus$5()
at com.dbumama.market.service.provider.MenuServiceImpl$$EnhancerByCGLIB$$72f696bc$$FastClassByCGLIB$$23bbc107.invoke()
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at com.jfinal.ext.proxy.CglibCallback.lambda$intercept$0(CglibCallback.java:58)
at com.jfinal.aop.Invocation.invoke(Invocation.java:101)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:61)
at io.jboot.components.limiter.LimiterInterceptor.intercept(LimiterInterceptor.java:50)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCacheInterceptor.intercept(JbootCacheInterceptor.java:44)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCachePutInterceptor.intercept(JbootCachePutInterceptor.java:35)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCachesEvictInterceptor.intercept(JbootCachesEvictInterceptor.java:43)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.components.cache.interceptor.JbootCacheEvictInterceptor.intercept(JbootCacheEvictInterceptor.java:37)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at io.jboot.support.metric.JbootMetricInterceptor.intercept(JbootMetricInterceptor.java:43)
at com.dbumama.market.aop.WeappAopInvocation.invoke(WeappAopInvocation.java:58)
at com.dbumama.market.aop.WeappAopInterceptor.intercept(WeappAopInterceptor.java:11)
at com.jfinal.aop.Invocation.invoke(Invocation.java:91)
at com.jfinal.ext.proxy.CglibCallback.intercept(CglibCallback.java:63)
at com.dbumama.market.service.provider.MenuServiceImpl$$EnhancerByCGLIB$$72f696bc.getFwMenus()
at com.alibaba.dubbo.common.bytecode.Wrapper40.invokeMethod(Wrapper40.java)
at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:47)
at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invoke(AbstractProxyInvoker.java:76)
at com.alibaba.dubbo.config.invoker.DelegateProviderMetaDataInvoker.invoke(DelegateProviderMetaDataInvoker.java:52)
at io.jboot.support.seata.filter.TransactionPropagationFilter.invoke(TransactionPropagationFilter.java:41)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:62)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:75)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.TimeoutFilter.invoke(TimeoutFilter.java:42)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.protocol.dubbo.filter.TraceFilter.invoke(TraceFilter.java:78)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.ContextFilter.invoke(ContextFilter.java:73)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:138)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:38)
at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:72)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:104)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:96)
at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:173)
at com.alibaba.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
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)

Wangzhen8

2019-11-13 17:42

这个错误怎么解决给回复一下谢谢

热门反馈

扫码入社