diff --git a/source/api-documentation.txt b/source/api-documentation.txt index 1dd63b1ca..86d82da6b 100644 --- a/source/api-documentation.txt +++ b/source/api-documentation.txt @@ -1,3 +1,5 @@ +.. _java-api-landing: + ================= API Documentation ================= diff --git a/source/faq.txt b/source/faq.txt index 5e398482d..f75c6b776 100644 --- a/source/faq.txt +++ b/source/faq.txt @@ -146,6 +146,30 @@ When ``MongoClient.close()`` is called by any thread, the driver closes all idle sockets and closes all sockets that are in use as they are returned to the pool. +How do I prevent the "java.lang.NoClassDefFoundError: com/mongodb/MongoClient" error? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You may encounter a ``java.lang.NoClassDefFoundError`` exception when your +Java runtime environment cannot locate a class file at runtime. When you +attempt to run application code that uses the {+driver-long+}, you must include +the appropriate driver JAR files on the classpath. + +If you receive this error after adding the {+driver-short+} JAR files to +your classpath, check the following items in your environment: + +- The JAR files exist in the locations specified by the classpath. +- The classpath syntax is correct. +- If you define the classpath in an environment variable, the Java runtime + environment uses that variable. +- If you use a dependency manager, it does not report any unresolvable conflicts. + +.. tip:: + + This error contains the package and class name, which can help you identify + which driver JAR may be missing from your classpath. To locate the + driver JAR that the error refers to, check each of the entries in the + :ref:`API documentation `. + How do I prevent the "IllegalArgumentException: Invalid BSON field name" error? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~