paypal web integration problem

Pauldon493
Contributor
Contributor

I am developing a web system and want to add paypal to enable credit card (and paypal) means of payment. I have been developing in java and it seems to be working fine on my localhost tomcat server. When I transfer my code to my internet server that is also running on tomcat everything works fine until I execute a create payment command i.e.  

 

Payment createdPayment = null;
createdPayment = payment.create(apiContext);

 

I have an error on the webserver :-

Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "setFactory")
at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.base/java.security.AccessController.checkPermission(AccessController.java:895)
at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:335)
at java.base/java.lang.SecurityManager.checkSetFactory(SecurityManager.java:1474)
at java.base/javax.net.ssl.HttpsURLConnection.setSSLSocketFactory(HttpsURLConnection.java:366)
at com.paypal.base.DefaultHttpConnection.createAndconfigureHttpConnection(DefaultHttpConnection.java:67)
at com.paypal.base.rest.OAuthTokenCredential.generateAccessToken(OAuthTokenCredential.java:360)
... 65 more

This is derived from :-

at com.paypal.base.rest.OAuthTokenCredential.generateAccessToken(OAuthTokenCredential.java:403)
at com.paypal.base.rest.OAuthTokenCredential.getAccessToken(OAuthTokenCredential.java:230)
at com.paypal.base.rest.APIContext.fetchAccessToken(APIContext.java:303)
at com.paypal.base.rest.PayPalResource.configureAndExecute(PayPalResource.java:282)
at com.paypal.base.rest.PayPalResource.configureAndExecute(PayPalResource.java:228)
at com.paypal.api.payments.Payment.create(Payment.java:149)
at com.gwtmaven2.server.GreetingServiceImpl.getAuthorization(GreetingServiceImpl.java:327)
at com.gwtmaven2.server.GreetingServiceImpl.RunPayPal(GreetingServiceImpl.java:163)

..

...

..

 

It seems that my internet host has some security that stops the payment object being created.

Maybe this also could be a paypal authorisation problem I do not know .

As I said works on my local tomcat but fails on host server as above .

I have raised this with the host people but they do not have the knowledge to fix this problem. 

Thanks for your help with this.

Regards

Paul <removed>

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.