• Welcome to KonaKart Community Forum. Please login or sign up.
 

sendTemplateEmailToCustomers1 - null pointer exception error

Started by giacomokk, June 05, 2017, 05:49:58 pm

Previous topic - Next topic

giacomokk

Hi, i'm trying to send emails to a specific customer using a vm template.

This is what i do using the soap API in my java class:


KKWSAdminIf adminEng;
adminEng = new KKWSAdminIfServiceLocator().getKKWSAdmin();
String sessionId = adminEng.login(<usr>,<psw>);

AdminCustomerSearch acs = new AdminCustomerSearch();
acs.setId(customerId);
adminEng.sendTemplateEmailToCustomers1(sessionId, acs, "EmailTemplateName", "test message", null, null, null, null, 1);


but i'm retrieving this error on tomcat logs from the web service:

KKAdmin threw an exception:
java.lang.NullPointerException
   at com.konakartadmin.bl.AdminCustomerMgr.sendTemplateEmailToCustomersWithOptions(Unknown Source)
   at com.konakartadmin.bl.AdminCustomerMgr.sendTemplateEmailToCustomers(Unknown Source)
   at com.konakartadmin.bl.KKAdmin.sendTemplateEmailToCustomers1(Unknown Source)
   at com.konakartadmin.ws.KKWSAdminSoapBindingImpl.sendTemplateEmailToCustomers1(Unknown Source)
   at com.konakartadmin.ws.KKWSAdminSoapBindingSkeleton.sendTemplateEmailToCustomers1(Unknown Source)
   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:497)
   at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
   at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
   at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
   at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
   at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
   at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
   at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
   at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
   at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
   at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
   at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
   at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
   at java.lang.Thread.run(Thread.java:745)


Can you help me?

Thanks.

Giacomo



giacomokk

I've tried to set the "expressionId" to "-1" in the AdminCustomerSearch object;

acs.setExpressionId(-1);

it solves the exception, but the email is not sent.

How can i exclude the expressions control in this method?

Brian

First of all I recommend you instantiate your engine this way:

KKAdminIf adminEng = new KKWSAdmin(adminEngineConfig);



I think you may be running into a problem in sendTemplatEmailToCustomers1 that was fixed in April - and will be available in the v8.7.0.0 release.

As a workaround for now, can you instead use sendTemplateEmailToCustomers1WithOptions and set Synchronousity in the AdminEmailOptions parameter to KKConstants.EMAIL_SYNCHRONOUS (value is 2).




giacomokk

Ok, Thankyou. It works!

But setting up sync mail,  can it affects app performances?

Brian

I don't think you'll notice any difference.   I'm not sure where you're calling it but it's normally an admin function anyway so it's not going to affect any response times to users.