Business Logic & Braintree integration - NoClassDefFoundError

I’m experimenting with adding a Braintree integration into the Business Logic. So I wrote a simple ApiService:

public class PaymentService implements IBackendlessService {
 public String getClientToken() {
 BraintreeGateway gateway = new BraintreeGateway(
 return gateway.clientToken().generate();
 public String getTestException() {
 return new BraintreeException("Exception").getMessage();

Creating service from uploaded .jar file went without any errors.
However executing GET /ClientToken returns an error:
400 - Type:“java.lang.NoClassDefFoundError”, Description:“Could not initialize class$DefaultSSLContext”, ExceptionClass:“ServiceException” {Msg:“none”, Cause:“none”}
Executing GET /TestException works fine.
I’ve tried this service in both - Backendles v3 and v4 - non of them worked.
Can you please suggest what can I do to fix this issue? Is this because there can be some network requests to Braintree API?

Hi Matt,

The calls in 3.x and 4.0 fail for different reasons.

In 3.x you need to add the host which the library communicates with per the instructions at:

In 4.0 there is currently a problem related to SSL initialization with CodeRunners running on our servers (it should work in the debug mode though).