Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

NumberFormatException occurs when using REST Connect with OAuth



NumberFormatException occurs when using REST Connect with OAuth autnetication.

Error Messages

Connect-REST configured with OAuth 2.0 is throwing a NumberFormatException trying to decrypt access token. Caught Exception while creating OAuth2 client 
at ~[printegrint.jar:?] at ~[printegrint.jar:?] at
at com.pega.pegarules.integration.engine.internal.util.OAuth2Utils.getDecrytedAccessToken( ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.util.OAuth2Utils.decryptAccessToken( ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.client.oauth2.OAuth2ClientImpl.getAccessToken( ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.client.oauth2.OAuth2ClientImpl.updateHttpRequestWithAccessToken( ~[printegrint.jar:?]  at com.pega.pegarules.integration.engine.internal.client.oauth2.OAuth2ClientImpl.updateHttpRequestWithAccessToken( ~[printegrint.jar:?]  at ~[printegrint.jar:?]

Steps to Reproduce

Create a REST Connect rule and test the connectivity.

Root Cause

The token size exceeded the 4000 database column size where the pr_data_token.pyaccesstoken is stored. The size of the the access token is 4001.


Perform the following local-change:
  1. Increase the column size to 6000 in the table pr_data_token for the pyaccesstoken column.
  2. Restart the server.

Published August 15, 2019 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us