@@ -10,6 +10,12 @@ Connect to MongoDB Using a JNDI Datasource
10
10
:depth: 2
11
11
:class: singlecol
12
12
13
+ .. facet::
14
+ :name: genre
15
+ :values: tutorial
16
+
17
+ .. meta::
18
+ :keywords: code example, wildfly, tomcat
13
19
14
20
Overview
15
21
--------
@@ -31,9 +37,15 @@ JNDI Datasource.
31
37
:tabid: wildfly
32
38
33
39
1. In a `Wildfly <https://wildfly.org/>`__ installation, create a new module
34
- for MongoDB at ``modules/system/layers/base/org/mongodb/main``. Copy the
35
- ``mongo-java-driver.jar`` jar file into the module. Add the following
36
- ``module.xml`` file into the module:
40
+ for MongoDB at ``modules/system/layers/base/org/mongodb/main``. Copy
41
+ the following jar files into the module:
42
+
43
+ - ``mongodb-driver-sync-{+full-version+}.jar``
44
+ - ``mongodb-driver-core-{+full-version+}.jar``
45
+ - ``bson-{+full-version+}.jar``
46
+ - ``bson-record-codec-{+full-version+}.jar``
47
+
48
+ Add the following ``module.xml`` file into the module:
37
49
38
50
.. literalinclude:: /includes/fundamentals/code-snippets/wildfly-module-with-version.xml
39
51
:language: xml
@@ -67,8 +79,13 @@ JNDI Datasource.
67
79
.. tab:: Tomcat
68
80
:tabid: tomcat
69
81
70
- 1. Copy the ``mongo-java-driver.jar`` jar file into the ``lib`` directory
71
- of your `Tomcat <https://tomcat.apache.org/>`__ installation.
82
+ 1. Copy the following jar files into the ``lib`` directory
83
+ of your `Tomcat <https://tomcat.apache.org/>`__ installation:
84
+
85
+ - ``mongodb-driver-sync-{+full-version+}.jar``
86
+ - ``mongodb-driver-core-{+full-version+}.jar``
87
+ - ``bson-{+full-version+}.jar``
88
+ - ``bson-record-codec-{+full-version+}.jar``
72
89
73
90
#. In the ``context.xml`` file of your application, add a resource that references
74
91
the ``MongoClientFactory`` class and the :ref:`connection string
@@ -78,7 +95,7 @@ JNDI Datasource.
78
95
79
96
<Resource name="mongodb/MyMongoClient"
80
97
auth="Container"
81
- type="com.mongodb.MongoClient"
98
+ type="com.mongodb.client. MongoClient"
82
99
closeMethod="close"
83
100
factory="com.mongodb.client.MongoClientFactory"
84
101
singleton="true"
0 commit comments