Skip to content

Conversation

@riyaaroraa
Copy link
Contributor

Defect #305111

This PR addresses the NoSuchElementException that was occurring in the SessionCacheConfigTestServlet.testMXBeansEnabled method. The issue was that the code was directly calling .next() on iterators without checking if they had elements, which could lead to NoSuchElementException when no MBeans were found.

The fix involves:

  1. Storing the query results in a Set variable
  2. Checking if the set is empty before attempting to get the next element
  3. Throwing a more descriptive exception if no MBeans are found

@riyaaroraa
Copy link
Contributor Author

riyaaroraa commented Oct 23, 2025

!build (view Open Liberty Personal Build - ✅ completed successfully!)

Note: Target locations of links might be accessible only to IBM employees.

@LibbyBot
Copy link
Member

Code analysis and actions

DO NOT DELETE THIS COMMENT.
  • 1 FAT files were changed, added, or removed.

  • Check that the build did not break the affected FAT suite(s).

  • Please describe in a separate comment how you tested your changes.

@riyaaroraa riyaaroraa self-assigned this Oct 23, 2025
Copy link
Contributor

@zhang-ca zhang-ca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants