Project and Portfolio Management Practitioners Forum
cancel

An Unhandled Exception occurs while sending mail java.lang.NullPointerException

Highlighted
abhishekkumar
Frequent Contributor.

An Unhandled Exception occurs while sending mail java.lang.NullPointerException

Hi,

We recently upgraded to PPM 9.32 from PPM 9.22 version and we have been experiencing a strange issue because of which PPM instance is going down every 24-48 hours and the whole serverLog.txt files are filled with errors like below.

 

ERROR :ppmLightServiceListenerContainer-1:(SMTPClient.java:258):2016/08/21-22:06:00.373 PDT: An Unhandled Exception occurs while sending mail
java.lang.NullPointerException
at com.kintana.core.net.SMTPClient.getMimeMessage(SMTPClient.java:292)
at com.kintana.core.net.SMTPClient.sendMessage(SMTPClient.java:226)
at com.kintana.core.server.EmailNotificationAgent.sendEmailImmediateOnly(EmailNotificationAgent.java:1077)
at com.kintana.core.server.EmailNotificationAgent.runService(EmailNotificationAgent.java:1279)
at com.mercury.itg.core.jms.service.impl.GenericServiceMessageHandler.handleMessage(GenericServiceMessageHandler.java:71)
at sun.reflect.GeneratedMethodAccessor263.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:77)
at com.mercury.itg.core.monitor.impl.BackgroundServiceMonitorAspect.monitorService(BackgroundServiceMonitorAspect.java:115)
at sun.reflect.GeneratedMethodAccessor262.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:627)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:616)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:160)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy140.handleMessage(Unknown Source)
at com.mercury.itg.core.jms.service.impl.ServiceMessageListenerImpl.onServiceMessage(ServiceMessageListenerImpl.java:360)
at com.mercury.itg.core.jms.service.impl.ServiceMessageListenerImpl.onMessage(ServiceMessageListenerImpl.java:184)
at sun.reflect.GeneratedMethodAccessor259.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
at com.sun.proxy.$Proxy142.onMessage(Unknown Source)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543)
at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)
at com.mercury.itg.core.jms.service.impl.ServiceMessageListenerContainer.access$2000(ServiceMessageListenerContainer.java:40)
at com.mercury.itg.core.jms.service.impl.ServiceMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(ServiceMessageListenerContainer.java:947)
at com.mercury.itg.core.jms.service.impl.ServiceMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(ServiceMessageListenerContainer.java:939)
at com.mercury.itg.core.jms.service.impl.ServiceMessageListenerContainer$AsyncMessageListenerInvoker.run(ServiceMessageListenerContainer.java:845)
at java.lang.Thread.run(Thread.java:744)

I am not sure what is the root cause of this. I checked the Audit Services page and it seems that notification service is showing exceptions on every run.

Any idea what is the issue?

Thanks and Regards,

Abhishek Kumar

1 REPLY
knsub
Super Contributor.

Re: An Unhandled Exception occurs while sending mail java.lang.NullPointerException

Hello Abhishek,

There could be pending notifications in the KNTA_NOTIF_TXN_PARENTS table. Check this table which has a column NOTIFICATION_SENT_FLAG having values 'N' and 'Y'.
The default value is set to 'N' when a notification is generated and once the notification is sent to the SMTP server the value of this flag is set to 'Y'.

If you find any old records with the NOTIFICATION_SENT_FLAG as 'N' we need to correct this.

Also check if there are any invalid e-mail addresses in the KNTA_NOTIF_TXN_RECIPIENTS table.

Hope this helps.

Thanks,
Subash