Azure Load Testing - Remove old MongoDB driver from classpath

Alexandre Senecal 0 Reputation points
2025-10-17T15:32:49.06+00:00

I want to run a load test where my test users are persisted in MongoDB.

Locally with JMeter 5.6.3 and JDK 21, I need to remove this old jar from the JMeter lib folder mongo-java-driver-2.14.3.jar. Once removed my uber jar gets loaded and everything works as expected.

In Azure I tried renaming my uber jar so it would get loaded first in the classpath but that didn't work.

What mechanism can I use to manage the classpath order of my dependencies in Azure Load Testing?

Azure Load Testing
Azure Load Testing
An Azure service that enables developers and testers to generate insights on how to improve the performance, scalability, and capacity usage of their application
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Vinodh247 40,051 Reputation points MVP Volunteer Moderator
    2025-11-26T00:40:44.2366667+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    azure load testing does not allow you to control or reorder the builtin JMeter classpath. The platform ships with its own JMeter runtime and embedded libraries, including the old MongoDB driver, and those cannot be removed, overridden, or reordered.

    The only reliable mechanism is to avoid the conflict entirely:

    Shade/relocate your MongoDB classes inside your uber jar using Maven Shade or Gradle Shadow. Relocate the com.mongodb packages to a custom namespace so that the built-in driver is never picked up.

    1. Do not rely on classpath order. load testing always loads its internal libs first, and you cannot change that.

    In short, you cannot manage classpath ordering in azure load testing. You must relocate your dependencies to avoid conflicts with the bundled JMeter libraries.

    Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.