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?
Hi, see the doc at https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationJBoss/
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/ using jboss-cli.sh Then I’ve got two files modules/org/postgresql/main/module.xml
<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.
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