Configuring MongoDB datasource in JBoss 7

做~自己de王妃 提交于 2020-01-06 13:54:19

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/30535259/configuring-mongodb-datasource-in-jboss-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!