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