I'm trying to generate a presigned URL with the exact code available on the documentation:
The full example is here:
Have you used the dependencies shown in the POM file in this Github location?
Other possible issues could be you set your S3 client object to the wrong region or have an issue with the key name as discussed here -- Amazon S3 - How to fix 'The request signature we calculated does not match the signature' error?.