ewanc
ewanc

Reputation: 1334

Configuring MongoDB datasource in JBoss 7

Does anyone know how I can configure a MongoDB datasource in JBoss AS 7?

I'm guessing I can set up the Mongo driver as a module in JBoss in the same way as I have done previously with a MySQL driver, then add a dependency to this in the manifest of my EAR. Is this the correct approach?

Upvotes: 0

Views: 1361

Answers (1)

ewanc
ewanc

Reputation: 1334

I couldn't find any documentation on this but it turns out to be pretty simple. Just download the driver and set it up as a module in JBoss like this.

Then add a dependency to the META-INF/MANFEST.MF file of your EAR. If you're using Maven you can add something like this to the configuration section of the EAR plugin in your pom.xml.

        <archive>
            <manifestEntries>
                <Dependencies>com.mongodb</Dependencies>
            </manifestEntries>
        </archive>

There doesn't seem to be any need to configure it as a data source. This is all I've done and I can see in the logs that the database is accepting connections.

Upvotes: 2

Related Questions