Skip to content

DOCSP-26370: FAQ entry for MongoSecurityException #427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion source/faq.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,32 @@ your classpath, check the following items in your environment:
:ref:`API documentation <java-api-landing>`.


How do I prevent the "com.mongodb.MongoSecurityException" error?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Your application might throw this exception if you specify invalid or
incorrectly formatted credentials when connecting to a MongoDB deployment.

If you receive this error when you attempt to connect to a MongoDB deployment,
check the following items in your code:

- The connection URI corresponds to the correct MongoDB deployment.
To learn more about setting your connection URI, see :ref:`connection-uri`.

- The credentials for the authentication mechanism that you specified are
correct. To learn how to specify your credentials, see the
:ref:`authentication-mechanisms` and :ref:`enterprise-authentication-mechanisms`
guides.

- The name of the authentication database that you specified is correct. To
learn how to set up the users and roles for your MongoDB deployment, see
`Manage Users and Roles <https://www.mongodb.com/docs/manual/tutorial/manage-users-and-roles/>`__
in the Server documentation.

How do I prevent the "IllegalArgumentException: Invalid BSON field name" error?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Your application may throw this exception if you pass an incorrectly formatted
Your application might throw this exception if you pass an incorrectly formatted
document to an operation and you are using a driver version v4.7 or earlier.

.. note::
Expand Down