@@ -151,6 +151,30 @@ When ``MongoClient.close()`` is called by any thread, the driver
151151closes all idle sockets and closes all sockets that are in
152152use as they are returned to the pool.
153153
154+ How do I prevent the "java.lang.NoClassDefFoundError: com/mongodb/MongoClient" error?
155+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
156+
157+ You may encounter a ``java.lang.NoClassDefFoundError`` exception when your
158+ Java runtime environment cannot locate a class file at runtime. When you
159+ attempt to run application code that uses the {+driver-long+}, you must include
160+ the appropriate driver JAR files on the classpath.
161+
162+ If you receive this error after adding the {+driver-short+} JAR files to
163+ your classpath, check the following items in your environment:
164+
165+ - The JAR files exist in the locations specified by the classpath.
166+ - The classpath syntax is correct.
167+ - If you define the classpath in an environment variable, the Java runtime
168+ environment uses that variable.
169+ - If you use a dependency manager, it does not report any unresolvable conflicts.
170+
171+ .. tip::
172+
173+ This error contains the package and class name, which can help you identify
174+ which driver JAR may be missing from your classpath. To locate the
175+ driver JAR that the error refers to, check each of the entries in the
176+ :ref:`API documentation <java-api-landing>`.
177+
154178
155179How do I prevent the "IllegalArgumentException: Invalid BSON field name" error?
156180~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments