This is regarding the post: BASIC authentication from JAVA to Sharepoint 2013 REST API
I am facing the same problem.
I tried the solutions provided over here but it did not work out for me. I am trying my luck to get the SharePoint Rest API working with Java but to no avail. It is showing the below error response:
Oct 03, 2017 8:23:49 PM org.apache.http.impl.auth.HttpAuthenticator generateAuthResponse
WARNING: NEGOTIATE authentication error:
No valid credentials provided
(Mechanism level: No valid credentials provided
(Mechanism level: Failed to find any Kerberos tgt))
----------------------------------------
HTTP/1.1 401 Processed