Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email notification scheduled job throws NullPointerException exception #6

Closed
lmann99 opened this issue Jan 22, 2017 · 1 comment
Closed

Comments

@lmann99
Copy link
Owner

lmann99 commented Jan 22, 2017

ERROR [20-January 06:03:05] [schedulerFactoryBean_Worker-3] org.quartz.core.JobRunShell - Job EMAIL.TASK_SHOULD_START threw an unhandled Exception:
java.lang.NullPointerException
at org.libreplan.importers.notifications.ComposeMessage.composeMessageForUser(ComposeMessage.java:138)
at org.libreplan.importers.notifications.realization.SendEmailOnTaskShouldStart.composeMessageForUser(SendEmailOnTaskShouldStart.java:101)
at org.libreplan.importers.notifications.realization.SendEmailOnTaskShouldStart.sendEmail(SendEmailOnTaskShouldStart.java:92)
at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at com.sun.proxy.$Proxy217.sendEmail(Unknown Source)
at org.libreplan.importers.notifications.jobs.SendEmailOnTaskShouldStartJob.executeInternal(SendEmailOnTaskShouldStartJob.java:48)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
ERROR [20-January 06:03:05] [schedulerFactoryBean_Worker-3] org.quartz.core.ErrorLogger - Job (EMAIL.TASK_SHOULD_START threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.NullPointerException
at org.libreplan.importers.notifications.ComposeMessage.composeMessageForUser(ComposeMessage.java:138)
at org.libreplan.importers.notifications.realization.SendEmailOnTaskShouldStart.composeMessageForUser(SendEmailOnTaskShouldStart.java:101)
at org.libreplan.importers.notifications.realization.SendEmailOnTaskShouldStart.sendEmail(SendEmailOnTaskShouldStart.java:92)
at sun.reflect.GeneratedMethodAccessor187.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
at com.sun.proxy.$Proxy217.sendEmail(Unknown Source)
at org.libreplan.importers.notifications.jobs.SendEmailOnTaskShouldStartJob.executeInternal(SendEmailOnTaskShouldStartJob.java:48)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:75)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
... 1 more

@lmann99
Copy link
Owner Author

lmann99 commented Jan 22, 2017

Issue looks to be related to notification resource not having an associated user.

lmann99 added a commit that referenced this issue Jan 22, 2017
…jobs

Added null checks. Moved getCurrentWorker to DAO as now being used by multiple routines.

Fixes #6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant