# How to configure xwiki on servlet

**URL:** <https://forum.xwiki.org/t/how-to-configure-xwiki-on-servlet/6041>\
**Category:** Help / Discuss\
**Created:** [December 29, 2019, 4:25pm UTC](https://forum.xwiki.org/t/how-to-configure-xwiki-on-servlet/6041 "2019-12-29T16:25:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![slava](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@slava](https://forum.xwiki.org/u/slava)\
**Post date:** [December 29, 2019, 4:25pm UTC](https://forum.xwiki.org/t/how-to-configure-xwiki-on-servlet/6041/1 "2019-12-29T16:25:46Z")

</div>

Hi, I haven’t any expiriens with deploying application on servlet. I’ve installed wildfly and I need to configure database connection. Should I change war file to set correct settings or there is another way?

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [December 29, 2019, 5:21pm UTC](https://forum.xwiki.org/t/how-to-configure-xwiki-on-servlet/6041/2 "2019-12-29T17:21:59Z")

</div>

Hi, see the doc at [https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationJBoss/](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationJBoss/)

---

<div class="post-metadata">

**Author:** ![slava](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/s/b487fb/32.png) [@slava](https://forum.xwiki.org/u/slava)\
**Post date:** [January 9, 2020, 9:36am UTC](https://forum.xwiki.org/t/how-to-configure-xwiki-on-servlet/6041/3 "2020-01-09T09:36:42Z")

</div>

Thanks for answer.  
There is written that I have to modify WEB-INF/hibernate.cfg.xml configuration file. Eventually, I setup pgsql driver like this [https://www.stenusys.com/how\_to\_setup\_postgresql\_datasource\_with\_wildfly/](https://www.stenusys.com/how_to_setup_postgresql_datasource_with_wildfly/) using jboss-cli.sh Then I’ve got two files modules/org/postgresql/main/module.xml

\<?xml version='1.0' encoding='UTF-8'?\>

```
<resources>
    <resource-root path="postgresql-42.2.9.jar"/>
</resources>

<dependencies>
    <module name="javax.api"/>
    <module name="javax.transaction.api"/>
</dependencies>

```

and file standalone/configuration/standalone.xml became to: (some lines is cut)

```
    <datasource jndi-name="java:jboss/datasources/XWikiDS" pool-name="XWikiDS">
            <connection-url>jdbc:postgresql://127.0.0.1:5432/xwiki</connection-url>
            <driver>postgres</driver>
            <security>
                    <user-name>xwikiuser</user-name>
                    <password>xwikipass</password>
            </security>
    </datasource>
    <drivers>
            <driver name="h2" module="com.h2database.h2">
                    <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
            </driver>
            <driver name="postgres" module="org.postgresql">
                    <driver-class>org.postgresql.Driver</driver-class>
            </driver>
    </drivers>

```

The next step is editing hibernate.cfg.xml to set properly connection but then I have to edit war file. Default hibernate.cfg.xml has a hsqldb connection. Is it necessary to rebild war file to set properly connection? Or is there another way to say xwiki get wildfly settings to connect DB. Thanks.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [April 6, 2020, 8:23am UTC](https://forum.xwiki.org/t/how-to-configure-xwiki-on-servlet/6041/4 "2020-04-06T08:23:03Z")

</div>

> [@slava](#):
>
> The next step is editing hibernate.cfg.xml to set properly connection but then I have to edit war file. Default hibernate.cfg.xml has a hsqldb connection. Is it necessary to rebild war file to set properly connection? Or is there another way to say xwiki get wildfly settings to connect DB. Thanks.

When I did this, I exploded the xwiki WAR on the filesystem, see [https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationJBoss/#HExampleusingStandaloneDeployment](https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationJBoss/#HExampleusingStandaloneDeployment)
