定时任务报错
wangkunk 发布于43月前 4答/1364阅

我的原始需求是:启动定时任务报错


实现过程中遇到的问题:

JFinal-4.9 action report -------- 2021-06-07 13:35:03 --------------------------

Url         : POST /task/trigger/12

Controller  : com.eova.core.task.TaskController.(TaskController.java:1)

Method      : trigger

UrlPara     : 12

Interceptor : com.eova.interceptor.LoginInterceptor.(LoginInterceptor.java:1)

              com.eova.interceptor.AuthInterceptor.(AuthInterceptor.java:1)

Parameter   : rows=[{"clazz":"com.oss.job.EveryDayJob","exp":"59 59 23 * * ? *","id":12,"info":"每天23点59分59秒跑一下","name":"每天","pk_val":12,"state":"暂停","state_val":0}]  

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

java.lang.NullPointerException

at com.eova.core.task.TaskController.trigger(TaskController.java:81)

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

at com.eova.interceptor.AuthInterceptor.intercept(AuthInterceptor.java:53)

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

at com.eova.interceptor.LoginInterceptor.intercept(LoginInterceptor.java:84)

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

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

at com.eova.handler.UrlBanHandler.handle(UrlBanHandler.java:47)

at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:81)

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

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.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68)

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

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

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

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

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

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

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

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

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

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)




[沙发] wangkunk
找到问题了,专业版把配置项isQuartz = true给移除了   数据库配置没看懂怎么调整才能生效   目前解决直接把这个配置到app.config文件中了
[地板] 扫地僧
@wangkunk 定时任务配置调用在数据库配置加载前 所以定时任务配置需要在配置文件中设置
你是什么版本 3.6.1应该已经修复了
[地毯] wangkunk
 专业版3.6.0   没看到经济版如何升级到3.6.1和3.7.0版本
[4楼] 扫地僧
@wangkunk 应用商店升级
提交评论