12-09-2016 08:37 AM
When using the Java SDK, I start the connection and it works fine for a while. But then eventually I get a message like this:
com.cisco.thunderhead.errors.UnauthorizedRestApiException: null: RestApiError with errorType: unAuthorized, errorData: NonBlockingOAuthClient expired token, errorMessage: Oauth token has expired and could not be refreshed
Is there a keepalive method I should be calling to keep the Oauth token from timing out? Or to request a new token?
12-09-2016 09:52 AM
Hi,
While you initialize SDK, SDK should start a thread to renew your OAuth token every hour. Token you get is valid for 2 hors but is refreshed every hour. You should not have to take extra steps for this. Seems like either SDK failed to start refresh thread of refresh token fails.
Did you see this error after 1 hour of using SDK or after 2 hours?
Can you please send more logs so we can do some investigation for this issue?
Thank you
Ankit
12-09-2016 10:28 AM
logs sent via Spark. Thanks
02-23-2017 06:15 AM
Was there any result to this analysis? Should I be able to run more than two hours at a time now?
02-28-2017 06:38 PM
Jeremy,
Sorry for the delay in response. Based on logs, we see that you are trying to use both Context and Management connector from same JVM. This is not supported by Context Service. Each connector needs to be running from separate JVM.
Thank you
Ankit Parikh
02-28-2017 06:42 PM
Can you ping me to the docs that outline that requirement?
03-01-2017 05:54 AM
Hi Jeremy,
Please refer to: Cisco DevNet: Context Service - Context Service SDK Guide
You cannot create both a management connection and client connection on the same Java virtual machine.
Thank you
Ankit Parikh
03-01-2017 06:09 AM
Was that block of text recently added? I don’t remember seeing that before…
03-01-2017 06:18 AM
Jeremy,
This line was added in the SDK Guide after you raised an issue with expired OAuth token. After debugging, we updated the DOC to indicate that running both connector on same JVM is not supported.
Context team should have reached out to you after our analysis. Again, I am sorry for the delay in response.
Thank you
Ankit Parikh
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide