Wiki source code of WildFly Installation

Last modified by Thomas Mortagne on 2025/10/23 11:03

Hide last authors
Vincent Massol 17.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
TharinduJayasuriya 1.5 4
Vincent Massol 31.1 5 = WildFly 27+ =
6
Thomas Mortagne 32.2 7 The instructions are mostly the same as for Wildly 24 below but:
8 * The package to download is "WildFly Distribution".
9 * Jakarta EE 8 (and so XWiki < 17) is not supported anymore.
Vincent Massol 31.1 10
Thomas Mortagne 32.2 11 = WildFly 24+ =
Vincent Massol 31.1 12
Thomas Mortagne 32.7 13 {{warning}}
Thomas Mortagne 32.10 14 You will need to add the [[required ##~~-~~-add-opens##>>https://dev.xwiki.org/xwiki/bin/view/Community/SupportStrategy/JavaSupportStrategy/]] to the WildFly configuration.
Thomas Mortagne 32.7 15 {{/warning}}
16
Thomas Mortagne 32.2 17 * Download and install the [[Jakarta EE Full & Web Distribution>>https://www.wildfly.org/downloads/]] (EE 8 for XWiki < 17, EE 9+ for XWiki > 17).
18 * Unzip the XWiki WAS in ##<wildfly>/standalone/deployments/xwiki.war##.
19 * Create a ##<wildfly>/standalone/deployments/xwiki.war.dodeploy## file.
Thomas Mortagne 35.1 20 * Start WildFly standalone: run ##<wildfly>/bin/standalone.sh## (or ##standalone.bat## on Windows)
Vincent Massol 31.1 21
Thomas Mortagne 36.1 22 You can customize various properties (for example, Java parameters like the memory and ##~-~-add-opens##) in ##<wildfly>/bin/standalone.conf##.
Thomas Mortagne 32.5 23
Thomas Mortagne 32.6 24 See https://docs.wildfly.org/ for more details.
25
Thomas Mortagne 32.2 26 = Troubleshooting =
Vincent Massol 27.2 27
Thomas Mortagne 32.2 28 == "More than the maximum number of request parameters" error ==
Vincent Massol 27.2 29
Vincent Massol 19.1 30 If you get the following error in the logs when trying to import a large XAR:
31
32 {{code}}
33 Servlet.service() for servlet action threw exception: java.lang.IllegalStateException: More than the maximum number of request parameters (GET plus POST) for a single request ([512]) were detected. Any parameters beyond this limit have been ignored. To change this limit, set the maxParameterCount attribute on the Connector.
34 {{/code}}
35
Manuel Smeria 20.2 36 You'll need to [[configure Tomcat in JBoss to support more than 512 form fields>>https://community.jboss.org/thread/177942]].
Vincent Massol 19.1 37
Vincent Massol 17.1 38 == Classloading Isolation ==
Vincent Massol 14.1 39
Vincent Massol 15.1 40 The default JBoss behavior is that classes inside of the ##WEB-INF/classes## and ##WEB-INF/lib## directories of the WAR file are incorporated into the default shared class loader repository. This allows classes and resources to be shared between web applications. However this means that JARs provided by XWiki in ##WEB-INF/lib## will get mixed with JARs provided by JBoss and if both application provide the same JAR but in a different version, class incompatibilities will occur.
Vincent Massol 14.1 41
Manuel Smeria 20.2 42 To solve this please read up on [[JBoss ClassLoading Configuration>>https://community.jboss.org/wiki/ClassLoadingConfiguration]] in order to configure JBoss not to use the unified class loader (set ##UseJBossWebLoader## to ##false## in ##META-INF/jboss-service.xml##).
Vincent Massol 15.1 43
44 Alternatively you may try to remove the clashing JARs from XWiki's ##WEB-INF/lib## hoping that the version provided by JBoss is compatible with XWiki's needs.
45
Vincent Massol 28.1 46 = Using a WildFly/JBoss DataSource =
TharinduJayasuriya 1.26 47
Vincent Massol 28.1 48 == Tutorial for JBoss AS 7.1+ ==
Sorin Burjan 20.3 49
Vincent Massol 28.1 50 * Create a JBoss Module for your database driver.
51 ** **HSQLDB**: create the directory ##[ROOT]/modules/org/hsqldb/main## and put the HSQLDB Driver JAR (e.g. ##hsqldb-2.2.9.jar##) in it and also create a ##module.xml## in it and write the following code inside:(((
Thomas Mortagne 32.1 52 {{code language="xml"}}
Vincent Massol 20.1 53 <?xml version="1.0" encoding="UTF-8"?>
54 <module xmlns="urn:jboss:module:1.0" name="org.hsqldb">
55 <resources>
56 <resource-root path="hsqldb-2.2.9.jar"/>
57 </resources>
58 <dependencies>
59 <module name="javax.api"/>
60 </dependencies>
61 </module>
62 {{/code}}
63 )))
Vincent Massol 28.1 64 ** **MySQL**: create the directory ##[ROOT]/modules/com/mysql/main## and put the MySQL Driver JAR (e.g. ##mysql-connector-java-5.1.48.jar##) in it and also create a ##module.xml## in it and write the following code inside:(((
Thomas Mortagne 32.1 65 {{code language="xml"}}
Vincent Massol 28.1 66 <?xml version="1.0" encoding="UTF-8"?>
67
68 <module xmlns="urn:jboss:module:1.1" name="com.mysql">
69 <resources>
70 <resource-root path="mysql-connector-java-5.1.48.jar"/>
71 </resources>
72 <dependencies>
73 <module name="javax.api"/>
74 <module name="javax.transaction.api"/>
75 <module name="javax.servlet.api" optional="true"/>
76 </dependencies>
77 </module>
78 {{/code}}
79 )))
80 * Edit the ##[ASROOT]/standalone/configuration/standalone.xml## file to add a new ##<datasource>## and a new ##<driver>## sections (adjust the properties as needed):
81 ** **MySQL**. Example:(((
Thomas Mortagne 32.1 82 {{code language="xml"}}
Vincent Massol 28.1 83 <datasources>
84 <datasource jta="true" jndi-name="java:jboss/datasources/XWikiDS" pool-name="XWikiDS" enabled="true" use-java-context="true" use-ccm="true">
85 <connection-url>jdbc:mysql://localhost:3306/xwiki?useSSL=false</connection-url>
86 <driver>mysql</driver>
87 <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
88 <pool>
89 <min-pool-size>10</min-pool-size>
90 <max-pool-size>100</max-pool-size>
91 <prefill>true</prefill>
92 </pool>
93 <security>
94 <user-name>xwiki</user-name>
95 <password>xwiki</password>
96 </security>
97 <statement>
98 <prepared-statement-cache-size>32</prepared-statement-cache-size>
99 <share-prepared-statements>true</share-prepared-statements>
100 </statement>
101 </datasource>
102 ...
103 <drivers>
104 <driver name="mysql" module="com.mysql">
105 <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
106 </driver>
107 ...
108 {{/code}}
109 )))
110 ** Note that it's also possible to create a data source file named ##-ds.xml## (e.g. ##hsqldb-ds.xml##) in ##[ASROOT]/standalone/deployments/## (you can also put it in your ##WEB-INF/## dir). Example of content for HSQLDB:(((
Vincent Massol 20.1 111 {{code}}
112 <?xml version="1.0" encoding="UTF-8"?>
113 <datasources xmlns="http://www.jboss.org/ironjacamar/schema">
114 <datasource jndi-name="java:jboss/datasources/XWikiDS" pool-name="XWikiDS" enabled="true" use-java-context="true">
115 <connection-url>jdbc:hsqldb:file:[path to your hsqldb db file, e.g. /tmp/xwiki-data/database/xwiki_db];shutdown=true</connection-url>
116 <driver>hsqldb</driver>
117 <security>
118 <user-name>sa</user-name>
119 <password></password>
120 </security>
121 </datasource>
122 </datasources>
123 {{/code}}
Vincent Massol 28.1 124
125 However it's not recommended because the deployment datasource feature should only be used in development environments, as the deployable datasources are considered as unmanaged datasource. Those are not recommended for production environments, because those can not be managed by the JBoss Management console or the management utilities like jboss-cli.sh. Hence such datasource cannot be managed like the managed dataSources which are configured inside the domain.xml or standalone*.xml files.
Vincent Massol 20.1 126 )))
Vincent Massol 28.1 127 * Modify XWiki's ##WEB-INF/hibernate.cfg.xml## file to tell Hibernate to use the defined DataSource rather than a direct JDBC connection:(((
128 {{code}}
Vincent Massol 29.1 129 <!-- This needs to be commented out since we're not going to use the DBCP connection pool (we're going to use the Data Source connection pool) -->
Vincent Massol 28.1 130 <!--property name="hibernate.connection.provider_class">com.xpn.xwiki.store.DBCPConnectionProvider</property-->
131 ...
132 <!-- Tells Hibernate to use the defined data source -->
133 <property name="connection.datasource">java:jboss/datasources/XWikiDS</property>
134
135 <!-- The following can be commented out since these are not needed as they are defined in the Data source definition -->
136 <!--
137 <property name="hibernate.connection.url">jdbc:hsqldb:file:${environment.permanentDirectory}/database/xwiki_db;shutdown=true</property>
138 <property name="hibernate.connection.username">sa</property>
139 <property name="hibernate.connection.password"></property>
140 <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
141 -->
142 ...
143 {{/code}}
144 )))
Vincent Massol 20.1 145
Thomas Mortagne 32.4 146 = Issues related to JBoss/WildFly =
Vincent Massol 18.1 147
Thomas Mortagne 25.1 148 {{jira URL="https://jira.xwiki.org" source="jql"}}
Thomas Mortagne 32.3 149 labels in (jboss,wildfly)
Vincent Massol 18.1 150 {{/jira}}

Get Connected