java.lang.NoSuchMethodError: com.squareup.square.ApiHelper$1.configOverride(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/cfg/MutableConfigOverride;

I am integrating the square API with my online website built using Java and Maven. I downloaded the Square API and followed the ‘my first usage’ example in this URL:

After building the project and running the main method in the Example class it fails on line 32:

        List<Location> locations = api.listLocations().getLocations();

And I receive this stack trace report:

java.lang.NoSuchMethodError: com.squareup.square.ApiHelper$1.configOverride(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/cfg/MutableConfigOverride;
at com.squareup.square.ApiHelper$1.(
at com.squareup.square.ApiHelper.(
at com.squareup.square.SquareClient.getBaseUri(
at com.squareup.square.SquareClient.getBaseUri(
at com.squareup.square.api.DefaultLocationsApi.buildListLocationsRequest(
at com.squareup.square.api.DefaultLocationsApi.listLocations(

Is anyone able to assist me as to why I am receiving this error? I have the latest dependency

as well as the Jackson dependencies that come with it.

Just an update: I have reverted back to a version of the Square API that doesn’t require Jackson dependencies and the examples work! However, the version used goes all the way back to square-, is there a way around this for recent versions? I don’t want to be left behin din updates because my IDE won’t run Jackson dependencies.

1 Like

Hi @cleary welcome to the forums!

I have been unable to reproduce this so far. I just created a new Java projected and added this to my pom.xml:


As for actual code all I put was:

SquareClient client = new SquareClient.Builder()

    LocationsApi api = client.getLocationsApi();

    try {
      List<Location> locations = api.listLocations().getLocations();
      System.out.println(locations.get(0).getId()); // just print first id to see if it works

If this is the same as yours, and still doesn’t work, it seems like something else is going wrong. Are you explicitly adding Jackson dependencies in your pom.xml?

Thank you for replying I really appreciate your hard work. From the research that I’ve done around this subject, it seems that the version of jackson-databind that contains configOverride is being overwritten by an incomplete version at some point a long the dependency path.

As to your code that is exactly what I am using to produce the error. A heads up that I am using Netbeans IDE and these are the dependencies I am currently running:

If you have any further ideas of how I can tackle this that would be great as it is preventing me from running the Square API.

1 Like

Thanks for sharing. Do you mind sharing the full list of dependencies from your pom.xml file? I’m also bringing this up with our SDK team to see if they have any thoughts.

1 Like

Hi Stephen, I have resolved this error.

I am running Glassfish Server 4.1.1, therein lies the problem. Glassfish has old versions of Jackson pre-installed on the server. It was a case of removing these versions through the modules folder and then replacing them with the most recent JAR files. I then updated the names of the downloaded JAR files so they were exactly the same as the old versions that were removed. This then allowed the dependencies to run without any errors.

I hope this helps anyone else using the Glassfish Server with Netbeans IDE and it may be something for the Square development team to think about if necessary at any point in the future.

I appreciate your support Stephen and I hope you have a great weekend.

Kind Regards,

Ben Cleary

Digital Developer


Thanks so much for posting your solution here, I truly appreciate that. Definitely do not hesitate to reach back out with further questions.

1 Like