service层调用同一个类内的方法报空指针

我在service层有做拦截器 GlobalServiceInterceptor.java 

就在我调用内部方法的时候报了空指针

image.png


报错信息如下

java.lang.NullPointerException

at com.scbc.service.ActionPlanService.deleteUploadFile(ActionPlanService.java:207)

at com.scbc.service.ActionPlanService$$EnhancerByJFinal.access$301(ActionPlanService$$EnhancerByJFinal.java:4)

at com.scbc.service.ActionPlanService$$EnhancerByJFinal.lambda$deleteUploadFile$4(ActionPlanService$$EnhancerByJFinal.java:71)

at com.scbc.service.ActionPlanService$$EnhancerByJFinal$$Lambda$38/2121632858.call(Unknown Source)

at com.jfinal.aop.Invocation.invoke(Invocation.java:101)

at com.scbc.common.GlobalServiceInterceptor.intercept(GlobalServiceInterceptor.java:21)

at com.jfinal.aop.Invocation.invoke(Invocation.java:91)

at com.scbc.service.ActionPlanService$$EnhancerByJFinal.deleteUploadFile(ActionPlanService$$EnhancerByJFinal.java:78)

at com.scbc.controller.ActionPlanController.deleteUploadFile(ActionPlanController.java:87)

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:483)

at com.jfinal.aop.Invocation.invoke(Invocation.java:97)

at com.jfinal.plugin.activerecord.tx.TxByActionKeyRegex.intercept(TxByActionKeyRegex.java:61)

at com.jfinal.aop.Invocation.invoke(Invocation.java:91)

at com.scbc.common.GlobalActionInterceptor.intercept(GlobalActionInterceptor.java:20)

at com.jfinal.aop.Invocation.invoke(Invocation.java:91)

at com.scbc.common.LoginInterceptor.intercept(LoginInterceptor.java:44)

at com.jfinal.aop.Invocation.invoke(Invocation.java:91)

at com.jfinal.core.ActionHandler.handle(ActionHandler.java:82)

at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:89)

at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)

at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132)

at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)

at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364)

at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:744)


调试定位到是 com.jfinal.aop.Invocation.invoke()  这个方法里

image.png

不知提供的信息够否,请波总明示,这是什么原因呢?

评论区

小智zaki

2019-10-12 11:00

啊!!找到问题了,低级错误,是我的sysFile为空