Not able to update JWT using updateProperties()


Hi Solace Community,

I am using the Java Api version 1.1

Currently I am experiencing a problem that I am unable to resolve where calling the "updateProperty()" function for the messaging service isn't logging, returning feedback or actually changing the JWT token that I am sending.

The JWT I am generating is successfully working for the initial connection but updateProperty doest not seem to replace it as after the expiry time passes I am getting 401 permission errors when it attemps to reconnect and the connection client is removed from the Solace event broker appliance.

I have tried executing the updateProperty, before it expires 5 min before it expires and after it expires and with no success in each of these cases it almost feels as if it is calling an empty stub method.

Here is the line used according to documentation the syntax should be correct.

`messageService.updateProperty(AuthenticationProperties.SCHEME_OAUTH2_ACCESS_TOKEN, jwt);`

Are there any pre-requirements I should be aware of so the updateProperty() method works? Right now I assume it needs to be already connected and use a non expired jwt are there other that I should be aware of and are my assumption correct?



  • marc
    marc Member, Administrator, Moderator, Employee Posts: 923 admin

    Hi @mabourahal2,

    Based on what you're explaining it seems like this should work. Can you share how you are including Solace related dependencies? Let's make sure you aren't including any specific versions of `sol-jcsmp` anywhere and are just getting what the Java API requires.

    Also, can you share debug logs from the application? If you aren't comfortable sharing them on the forum you an open a support ticket with that info.

  • mabourahal2
    mabourahal2 Member Posts: 6

    Hi Marc, yea I am currently looking into it wit ha support ticket. But I just wanted to confirm during some down time if my assumption were correct about the pre requirements.

    I am only importing the Java Api Jar and nothing else.






  • mabourahal2
    mabourahal2 Member Posts: 6

    One error that was found in the logs that I don't understand is this

    "Multiple tokens were provided but OAuth role is resource server"

    What does this error mean and how can I avoid running into this error.