Wiki source code of Geronimo Installation

Last modified by Vincent Massol on 2017/09/06

Show last authors
1 {{box cssClass="floatinginfobox" title="**Contents**"}}{{toc/}}{{/box}}
2
3 =Apache Geronimo Installation=
4
5 {{info}}
6 * This was written for version **//2.2//**. There is no reason why it wouldn't work on other platforms.
7 * The default username for Geronimo is **//system//** and the default password is **//manager//**.
8 {{/info}}
9
10 Out of the box you will have issues with Geronimo, but these are not hard to fix. This was the error I got that lead me down the path to writing this deployment guide for Geronimo:
11
12 {{error}}
13 Error 500 org.apache.commons.lang.StringUtils.replaceEach(Ljava/lang/String;[Ljava/lang/String;[Ljava/lang/String;
14 {{/error}}
15
16 == Quick Steps ==
17
18 For the impatient, the steps to get it working are:
19 * Add Apache commons language to the repository
20 * Create a ##geronimo-web.xml## file and add it to your war file
21 * Make your changes as per a normal installation (i.e., to the ##xwiki.cfg##, ##hibernate.cfg.xml##, etc.)
22 The optional steps I did were:
23 * Add a higher version of commons-beanutils to repository
24 * Add a higher version of commons-fileupload to repository
25 * Add a higher version of commons-io to repository
26
27 === Minimum XML Changes ===
28
29 Modify your ##geronimo-web.xml## and add the following library to match how you installed the library into the repository:
30
31 {{code language="xml"}}
32 <dependency>
33 <groupId>apache-commons</groupId>
34 <artifactId>commons-lang</artifactId>
35 <version>2.5</version>
36 <type>jar</type>
37 </dependency>
38 {{/code}}
39
40 = All Changes =
41
42 == geronimo-web.xml ==
43
44 Here is a sample deployment resource xml file:
45
46 {{code language="xml"}}
47
48 <?xml version="1.0" encoding="UTF-8"?>
49 <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1">
50 <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">
51 <!--
52 ** GroupID : The grouping you put xwiki in, like your parent container I guess.
53 ** ArtifactID : Same as the war name, full name + version.
54 ** Version : A version of the software.
55 ** Type : Type of deployment. In this case a WAR archive.
56 -->
57 <dep:moduleId>
58 <dep:groupId>default</dep:groupId>
59 <dep:artifactId>xwiki-enterprise-web-2.3.1</dep:artifactId>
60 <dep:version>1275530872796</dep:version>
61 <dep:type>war</dep:type>
62 </dep:moduleId>
63 <!--
64 ** Configure the JDBC connection pool, in this case the pool is based on H2 database.
65 ** It is here you would configure your oracle, postgres, mysql, sqlserver, etc pool drivers.
66 -->
67 <dep:dependencies>
68 <dep:dependency>
69 <dep:groupId>jdbc</dep:groupId>
70 <dep:artifactId>h2</dep:artifactId>
71 <dep:version>1.2.136</dep:version>
72 <dep:type>jar</dep:type>
73 </dep:dependency>
74 <!-- The location of the pool -->
75 <dependency>
76 <groupId>console.dbpool</groupId>
77 <artifactId>XWikiDS</artifactId>
78 </dependency>
79 </dep:dependencies>
80 <!-- Libraries
81 ** This is where I specified the libraries that were out of date in geronimo
82 ** that lead to it not working. There might be better ways, but this was how
83 ** I did it to get it working quickly.
84 -->
85 <!-- Required -->
86 <dependency>
87 <groupId>apache-commons</groupId>
88 <artifactId>commons-lang</artifactId>
89 <version>2.5</version>
90 <type>jar</type>
91 </dependency>
92 <!-- Optional -->
93 <dependency>
94 <groupId>apache-commons</groupId>
95 <artifactId>commons-beanutils</artifactId>
96 <version>1.8.3</version>
97 <type>jar</type>
98 </dependency>
99 <!-- Optional -->
100 <dependency>
101 <groupId>apache-commons</groupId>
102 <artifactId>commons-fileupload</artifactId>
103 <version>1.2.1</version>
104 <type>jar</type>
105 </dependency>
106 <!-- Optional -->
107 <dependency>
108 <groupId>apache-commons</groupId>
109 <artifactId>commons-io</artifactId>
110 <version>1.4</version>
111 <type>jar</type>
112 </dependency>
113
114 </dep:environment>
115 <!-- Whatever the webroot you want, ie http://127.0.0.1/xwiki -->
116 <context-root>xwiki</context-root>
117 <!--
118 ** Map the reference to the JDBC pool located at resource-link to the jndi location ref-name
119 -->
120 <resource-ref>
121 <ref-name>jdbc/XWikiDS</ref-name>
122 <resource-link>XWikiDS</resource-link>
123 </resource-ref>
124
125 </web-app>
126
127 {{/code}}
128
129 == Warnings In The Log File ==
130
131 {{warning}}
132 * 37866: 2010-06-03 15:12:03,484 WARN [RequestUtils] No FormBeanConfig found under 'download'
133 * 39221: 2010-06-03 15:12:18,062 WARN [RequestUtils] No FormBeanConfig found under 'get'
134 * 39804: 2010-06-03 15:12:21,046 WARN [RequestUtils] No FormBeanConfig found under 'view'
135 {{/warning}}
136
137 I saw these in the log files and apparently you can just ignore them.
138
139 == Using a JDBC Datasource ==
140
141 Navigate to Geronimo -> Services -> Database Pools and click the //Using the Geronimo database pool wizard// link.
142
143 === Step 1: Select Name and Database ===
144
145 Name of Database Pool: {{box}}<Pool Name>{{/box}}
146 A name that is different than the name of any other database pools in the server (no spaces in the name please).
147
148 Database Type: {{box}}<Database Version>{{/box}}
149 The type of database the pool will connect to.
150
151 === Step 2: Select Driver, JAR, Parameters ===
152
153 JDBC Driver Class: {{box}}<driver>{{/box}} (e.g. //org.h2.Driver//)
154 Driver JAR: {{box}}<jarfile for the driver>{{/box}} (e.g. //jdbc/h2/1.2.136/jar//)
155 DB User Name: {{box}}<username>{{/box}}
156 DB Password: {{box}}<password>{{/box}}
157 Confirm Password: {{box}}<password>{{/box}}
158
159 === Step 3: Final Pool Configuration ===
160
161 JDBC Connect URL: {{box}}<url>{{/box}} (e.g. //jdbc:h2:tcp:~/~/localhost~/xwiki23//)
162 Make sure the generated URL fits the syntax for your JDBC driver.
163 Driver Status: Loaded Successfully
164 Connection Pool Parameters
165 Transaction Type: {{box}}LOCAL{{/box}}
166
167 Type of transactions that this connection pool supports.
168 Pool Min Size: {{box}}0{{/box}}
169
170 The minimum number of connections in the pool. Leave blank for default.
171 Pool Max Size: {{box}}10{{/box}}
172
173 The maximum number of connections in the pool. Leave blank for default.
174 Blocking Timeout: {{box}}<default>{{/box}} (in milliseconds)
175
176 The length of time a caller will wait for a connection. Leave blank for default.
177 Idle Timeout: {{box}}<default>{{/box}} (in minutes)

Get Connected