SAP Knowledge Base Article - Preview

3686311 - AmbiguousIdentifierException: "found 2 results for the given query" when generating an OAuth token

Symptom

When trying to generate an OAuth token via POST request or other actions will get an Internal Server Error. Checking in the logs, can find the exceptions like below:

......
"ERROR","loggerName":"org.springframework.security.oauth2.provider.endpoint.TokenEndpoint",
"message":"Handling error: AmbiguousIdentifierException, Found 2 results for the given query",
"thrown":{"commonElementCount":0,"localizedMessage":"Found 2 results for the given query",
"message":"Found 2 results for the given query","name":"de.hybris.platform.servicelayer.exceptions.AmbiguousIdentifierException",
"extendedStackTrace":[{"class":"de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService",
"method":"searchUnique","file":"DefaultFlexibleSearchService.java","line":362,"exact":false,"location":"coreserver.jar","version":"?"},{"class":"de.hybris.platform.servicelayer.internal.dao.AbstractItemDao","method":"searchUnique","file":"AbstractItemDao.java","line":71,"exact":false,"location":"coreserver.jar","version":"?"},{"class":"de.hybris.platform.webservicescommons.oauth2.token.dao.impl.DefaultOAuthTokenDao","method":"findAccessTokenByAuthenticationId","file":"DefaultOAuthTokenDao.java","line":94,"exact":false,"location":"oauth2server.jar","version":"?"},{"class":"de.hybris.platform.webservicescommons.oauth2.token.impl.DefaultOAuthTokenService$8","method":"execute","file":"DefaultOAuthTokenService.java","line":268,"exact":false,"location":"oauth2server.jar","version":"?"},{"class":"de.hybris.platform.servicelayer.session.impl.DefaultSessionService","method":"executeInLocalView","file":"DefaultSessionService.java","line":82,"exact":false,"location":"coreserver.jar","version":"?"},{"class":"de.hybris.platform.webservicescommons.oauth2.token.impl.DefaultOAuthTokenService","method":"getAccessTokenForAuthentication","file":"DefaultOAuthTokenService.java","line":260,"exact":false,"location":"oauth2server.jar","version":"?"},{"class":"de.hybris.platform.webservicescommons.oauth2.token.provider.HybrisOAuthTokenStore","method":"getAccessToken","file":"HybrisOAuthTokenStore.java","line":52,"exact":false,"location":"oauth2server.jar","version":"?"},{"class":"org.springframework.security.oauth2.provider.token.DefaultTokenServices","method":"createAccessToken","file":"DefaultTokenServices.java","line":96,"exact":false,"location":"spring-security-oauth2-2.5.2.RELEASE.jar","version":"?"},
......


Read more...

Environment

  • SAP Commerce Cloud
  • SAP Commerce

Product

SAP Commerce Cloud all versions ; SAP Commerce all versions

Keywords

ambiguous identifier exception, duplicate authentication id, oauthaccesstoken, unique index, p_authenticationid, refresh token, occ, oauth , KBA , CEC-SCC-COM-BC-OCC , Commerce Web Services - OCC , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.