This error occurs because you specified MessageDigest as a parameter to the ServerController.myHash() method. So when you send a request to your application, Spring tries to create an instance of MessageDigest, but it can't do so because MessageDigest doesn't have an accessible constructor. You should remove MessageDigest from the parameters and move the MessageDigest creation code from the SslServerApplication.main() method to ServerController.myHash().