Paypal Integration Throwing Custom Script Execution Error

Any issue about Cyclos 4 scripting and Webservices

Moderators: hugo, alexandre, rmvanarkel

Post Reply
barry
Posts: 92
Joined: Fri Oct 26, 2012 9:42 am

Paypal Integration Throwing Custom Script Execution Error

Post by barry » Sun Nov 12, 2017 6:03 am

Hi Admin,

I set up a Paypal Sandbox integration and it is working fine. I follow same steps to setup on another Cyclos installation and when I login as a user with permission
to perform such transactions, I get the error message below"

"A custom script execution has caused an error. Please, contact the administration ".

Kindly assist pls.

Warm regards,
Barry

barry
Posts: 92
Joined: Fri Oct 26, 2012 9:42 am

Re: Paypal Integration Throwing Custom Script Execution Erro

Post by barry » Mon Nov 13, 2017 9:07 am

Hi Admin,

The issue still persist. I read through a similar issue reported here and I tried following the solutions but nothing happened. I use version 4.8.5 and my logs are displayed below for your assistance.

org.cyclos.model.system.scripts.CustomScriptException: Error invoking the custom script CustomScript#4: MyCashBox top up with PayPal, function DEFAULT
at org.cyclos.impl.system.CustomScriptServiceImpl$CustomScriptAccessorImpl.lambda$run$0(CustomScriptServiceImpl.java:297)
at org.cyclos.impl.system.CustomScriptServiceImpl$CustomScriptAccessorImpl$$Lambda$429/1936011170.call(Unknown Source)
at org.cyclos.impl.InvokerHandlerImpl.runAs(InvokerHandlerImpl.java:109)
at org.cyclos.impl.system.CustomScriptServiceImpl$CustomScriptAccessorImpl.run(CustomScriptServiceImpl.java:286)
at org.cyclos.impl.system.CustomOperationServiceImpl.doRun(CustomOperationServiceImpl.java:1174)
at org.cyclos.impl.system.CustomOperationServiceImpl.handleUrl(CustomOperationServiceImpl.java:1570)
at org.cyclos.impl.system.CustomOperationServiceImpl.run(CustomOperationServiceImpl.java:752)
at org.cyclos.security.system.CustomOperationServiceSecurity.run(CustomOperationServiceSecurity.java:178)
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.cyclos.impl.ServiceInvokerHandlerImpl$ServiceInvocationTransactionCallback.performInvocation(ServiceInvokerHandlerImpl.java:308)
at org.cyclos.impl.ServiceInvokerHandlerImpl$ServiceInvocationTransactionCallback$$Lambda$107/2056437486.call(Unknown Source)
at org.cyclos.impl.InvokerHandlerImpl.runAs(InvokerHandlerImpl.java:109)
at org.cyclos.impl.ServiceInvokerHandlerImpl$ServiceInvocationTransactionCallback.doInTransaction(ServiceInvokerHandlerImpl.java:255)
at org.cyclos.impl.ServiceInvokerHandlerImpl$ServiceInvocationTransactionCallback.doInTransaction(ServiceInvokerHandlerImpl.java:234)
at org.cyclos.impl.utils.transaction.TransactionHandlerImpl.runEnsuringInvocationContext(TransactionHandlerImpl.java:190)
at org.cyclos.impl.utils.transaction.TransactionHandlerImpl.doRun(TransactionHandlerImpl.java:110)
at org.cyclos.impl.utils.transaction.TransactionHandlerImpl.run(TransactionHandlerImpl.java:166)
at org.cyclos.impl.utils.transaction.TransactionHandlerImpl.run(TransactionHandlerImpl.java:80)
at org.cyclos.impl.InvokerHandlerImpl.performInTransaction(InvokerHandlerImpl.java:236)
at org.cyclos.impl.InvokerHandlerImpl.doRunAsInTransaction(InvokerHandlerImpl.java:185)
at org.cyclos.impl.InvokerHandlerImpl.runAsInTransaction(InvokerHandlerImpl.java:165)
at org.cyclos.impl.ServiceInvokerHandlerImpl.doInvoke(ServiceInvokerHandlerImpl.java:661)
at org.cyclos.impl.ServiceInvokerHandlerImpl.invoke(ServiceInvokerHandlerImpl.java:534)
at org.cyclos.impl.access.ServiceFacadeImpl.invoke(ServiceFacadeImpl.java:135)
at org.cyclos.server.spring.root.RequestServiceFactory$ServiceProxyInvocationHandler.invoke(RequestServiceFactory.java:74)
at com.sun.proxy.$Proxy101.run(Unknown Source)
at org.cyclos.server.content.system.CustomOperationsController.doRun(CustomOperationsController.java:66)
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.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.cyclos.server.http.CORSFilter.doFilterInternal(CORSFilter.java:65)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.cyclos.server.http.RequestDataFilter.doFilterInternal(RequestDataFilter.java:208)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.cyclos.server.http.RequestContextFilter.doFilterInternal(RequestContextFilter.java:52)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:844)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2400)
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)
Caused by: javax.script.ScriptException: java.lang.RuntimeException: Error getting PayPal token, got error code 401: Unauthorized
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:346)
at org.codehaus.groovy.jsr223.GroovyCompiledScript.eval(GroovyCompiledScript.java:72)
at javax.script.CompiledScript.eval(CompiledScript.java:92)
at org.cyclos.impl.system.CustomScriptServiceImpl$CustomScriptAccessorImpl.lambda$run$0(CustomScriptServiceImpl.java:288)
... 83 more
Caused by: java.lang.RuntimeException: Error getting PayPal token, got error code 401: Unauthorized
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at PayPalService.refreshToken(Script14.groovy:396)
at PayPalService.postJson(Script14.groovy:332)
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.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
at PayPalService.createPayment(Script14.groovy:282)
at PayPalService$createPayment.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
at Script14.run(Script14.groovy:410)
at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:343)
... 86 more

barry
Posts: 92
Joined: Fri Oct 26, 2012 9:42 am

Re: Paypal Integration Throwing Custom Script Execution Erro

Post by barry » Wed Nov 15, 2017 9:10 am

Hi Admin,

Issue has been resolved!

Post Reply