Skip to content

Commit 72e1ed0

Browse files
AP: fix springbootdemo WildFly build and clarify Tomcat vs WildFly docs
- Update springbootdemo/pom.xml Axis2 versions 2.0.0-SNAPSHOT -> 2.0.1-SNAPSHOT so local Maven install resolves correctly - Fix Tomcat11 guide: context root is / (ROOT deployment), not /axis2-json-api; correct all curl example URLs accordingly - Replace 2-item differences list with a full comparison table in Tomcat11 guide covering: context root, deploy method, WildFly-specific files, DataSource auto-config exclusion, HTTP/2 config, and JSON format - Add concise WildFly vs Tomcat differences summary in WildFly guide with link to Tomcat11 guide Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f63de99 commit 72e1ed0

3 files changed

Lines changed: 69 additions & 32 deletions

File tree

modules/samples/userguide/src/userguide/springbootdemo/pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,18 @@
171171
<dependency>
172172
<groupId>org.apache.axis2</groupId>
173173
<artifactId>axis2-kernel</artifactId>
174-
<version>2.0.0-SNAPSHOT</version>
174+
<version>2.0.1-SNAPSHOT</version>
175175
</dependency>
176176
<dependency>
177177
<groupId>org.apache.axis2</groupId>
178178
<artifactId>axis2-transport-http</artifactId>
179-
<version>2.0.0-SNAPSHOT</version>
179+
<version>2.0.1-SNAPSHOT</version>
180180
</dependency>
181181
<!-- HTTP/2 Transport for Enterprise Big Data Processing -->
182182
<dependency>
183183
<groupId>org.apache.axis2</groupId>
184184
<artifactId>axis2-transport-h2</artifactId>
185-
<version>2.0.0-SNAPSHOT</version>
185+
<version>2.0.1-SNAPSHOT</version>
186186
</dependency>
187187
<!-- HTTP/2 Dependencies -->
188188
<dependency>
@@ -193,42 +193,42 @@
193193
<dependency>
194194
<groupId>org.apache.axis2</groupId>
195195
<artifactId>axis2-transport-local</artifactId>
196-
<version>2.0.0-SNAPSHOT</version>
196+
<version>2.0.1-SNAPSHOT</version>
197197
</dependency>
198198
<dependency>
199199
<groupId>org.apache.axis2</groupId>
200200
<artifactId>axis2-json</artifactId>
201-
<version>2.0.0-SNAPSHOT</version>
201+
<version>2.0.1-SNAPSHOT</version>
202202
</dependency>
203203
<dependency>
204204
<groupId>org.apache.axis2</groupId>
205205
<artifactId>axis2-ant-plugin</artifactId>
206-
<version>2.0.0-SNAPSHOT</version>
206+
<version>2.0.1-SNAPSHOT</version>
207207
</dependency>
208208
<dependency>
209209
<groupId>org.apache.axis2</groupId>
210210
<artifactId>axis2-adb</artifactId>
211-
<version>2.0.0-SNAPSHOT</version>
211+
<version>2.0.1-SNAPSHOT</version>
212212
</dependency>
213213
<dependency>
214214
<groupId>org.apache.axis2</groupId>
215215
<artifactId>axis2-java2wsdl</artifactId>
216-
<version>2.0.0-SNAPSHOT</version>
216+
<version>2.0.1-SNAPSHOT</version>
217217
</dependency>
218218
<dependency>
219219
<groupId>org.apache.axis2</groupId>
220220
<artifactId>axis2-metadata</artifactId>
221-
<version>2.0.0-SNAPSHOT</version>
221+
<version>2.0.1-SNAPSHOT</version>
222222
</dependency>
223223
<dependency>
224224
<groupId>org.apache.axis2</groupId>
225225
<artifactId>axis2-spring</artifactId>
226-
<version>2.0.0-SNAPSHOT</version>
226+
<version>2.0.1-SNAPSHOT</version>
227227
</dependency>
228228
<dependency>
229229
<groupId>org.apache.axis2</groupId>
230230
<artifactId>axis2-jaxws</artifactId>
231-
<version>2.0.0-SNAPSHOT</version>
231+
<version>2.0.1-SNAPSHOT</version>
232232
</dependency>
233233
<dependency>
234234
<groupId>org.apache.neethi</groupId>

src/site/xdoc/docs/json-springboot-tomcat11-userguide.xml

Lines changed: 43 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,41 @@ prefix the subject of the mail with [Axis2].</p>
7474

7575
<p>This guide is based on the
7676
<a href="json-springboot-userguide.html">Apache Axis2 JSON and REST with Spring Boot 3 User's Guide</a>,
77-
which targets WildFly 32. The code and configuration are identical except for two points:</p>
78-
79-
<ol>
80-
<li><strong>No WildFly-specific deployment descriptors:</strong> The files
81-
<code>src/main/webapp/WEB-INF/jboss-deployment-structure.xml</code> and
82-
<code>src/main/webapp/WEB-INF/jboss-web.xml</code> are WildFly-only and must
83-
<em>not</em> be present in the Tomcat deployment. The
84-
<code>springbootdemo-tomcat11</code> sample directory does not include these files.</li>
85-
<li><strong>HTTP/2 requires Tomcat native (APR/NIO2) or Java 9+ ALPN:</strong>
86-
Tomcat 11 supports HTTP/2 via NIO2 with Java 9+ ALPN — no native library required.
87-
See the <a href="#tomcat11-http2">Enabling HTTP/2 on Tomcat 11</a> section below.</li>
88-
</ol>
77+
which targets WildFly 32. The following table summarises all differences:</p>
78+
79+
<table border="1" cellpadding="4">
80+
<tr><th>Aspect</th><th>WildFly 32</th><th>Tomcat 11</th></tr>
81+
<tr>
82+
<td><strong>Context root</strong></td>
83+
<td><code>/axis2-json-api</code> (WAR name becomes context root automatically)</td>
84+
<td><code>/</code> (deployed into <code>webapps/ROOT/</code>); base URL is <code>http://localhost:8080/services/...</code></td>
85+
</tr>
86+
<tr>
87+
<td><strong>Deploy method</strong></td>
88+
<td>Copy WAR directory to <code>standalone/deployments/</code>, then <code>touch axis2-json-api.war.dodeploy</code></td>
89+
<td><code>cp -r target/deploy/axis2-json-api.war/* $CATALINA_HOME/webapps/ROOT/</code> then start Tomcat</td>
90+
</tr>
91+
<tr>
92+
<td><strong>WildFly-specific files</strong></td>
93+
<td><code>WEB-INF/jboss-deployment-structure.xml</code>, <code>WEB-INF/jboss-web.xml</code> required</td>
94+
<td>These files must <em>not</em> be present; <code>springbootdemo-tomcat11</code> omits them</td>
95+
</tr>
96+
<tr>
97+
<td><strong>DataSource auto-configuration</strong></td>
98+
<td>WildFly's JPA subsystem suppresses Spring Boot's DataSource auto-config automatically</td>
99+
<td>Must exclude explicitly in <code>@SpringBootApplication</code>:
100+
<code>exclude={DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class}</code></td>
101+
</tr>
102+
<tr>
103+
<td><strong>HTTP/2 configuration</strong></td>
104+
<td>Configured via WildFly subsystem</td>
105+
<td>Requires <code>&lt;UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol"/&gt;</code> in <code>server.xml</code> HTTPS connector; Java 9+ ALPN, no native library needed</td>
106+
</tr>
107+
<tr>
108+
<td><strong>JSON request format</strong></td>
109+
<td colspan="2">Identical for both servers: <code>{"methodName":[{"paramName":{...}}]}</code></td>
110+
</tr>
111+
</table>
89112

90113
<p>All sample source code for this guide is located in
91114
the <b>"modules/samples/userguide/src/springbootdemo-tomcat11"</b> directory of <a
@@ -204,7 +227,9 @@ tail -f $CATALINA_HOME/logs/catalina.out
204227
</pre>
205228

206229
<p>You should see the Spring Boot application context starting and Axis2 servlet registering
207-
without errors. The context path will be <code>/axis2-json-api</code> (matching the WAR filename).</p>
230+
without errors. Because the contents are deployed into <code>webapps/ROOT/</code>, the context
231+
root is <code>/</code> — service URLs begin with <code>http://localhost:8080/services/...</code>,
232+
<em>not</em> <code>/axis2-json-api/services/...</code> as on WildFly.</p>
208233

209234
<h2>Getting Started</h2>
210235

@@ -406,7 +431,7 @@ sender configuration to your axis2.xml file:</p>
406431
Invoking the client for a login that returns a token can be done as follows:
407432
</p>
408433
<pre>
409-
curl -v -H "Content-Type: application/json" -X POST --data @/home/myuser/login.dat http://localhost:8080/axis2-json-api/services/loginService
434+
curl -v -H "Content-Type: application/json" -X POST --data @/home/myuser/login.dat http://localhost:8080/services/loginService
410435
</pre>
411436
<p>
412437
Where the contents of /home/myuser/login.dat are:
@@ -425,7 +450,7 @@ Invoking the client for a Test Service that validates a sample token can be done
425450
follows:
426451
</p>
427452
<pre>
428-
curl -v -H "Authorization: Bearer 95104Rn2I2oEATfuI90N" -H "Content-Type: application/json" -X POST --data @/home/myuser/test.dat http://localhost:8080/axis2-json-api/services/testws'
453+
curl -v -H "Authorization: Bearer 95104Rn2I2oEATfuI90N" -H "Content-Type: application/json" -X POST --data @/home/myuser/test.dat http://localhost:8080/services/testws'
429454
</pre>
430455
<p>
431456
Where the contents of /home/myuser/test.dat are below. arg0 is a var name
@@ -455,7 +480,7 @@ curl -v -H "Authorization: Bearer 95104Rn2I2oEATfuI90N" \
455480
-H "Content-Type: application/json" \
456481
-X POST \
457482
--data @/home/myuser/small_dataset.dat \
458-
https://localhost:8443/axis2-json-api/services/BigDataH2Service
483+
https://localhost:8443/services/BigDataH2Service
459484
</pre>
460485

461486
<p>Where the contents of /home/myuser/small_dataset.dat are:</p>
@@ -479,7 +504,7 @@ curl -v -H "Authorization: Bearer 95104Rn2I2oEATfuI90N" \
479504
-H "Content-Type: application/json" \
480505
-X POST \
481506
--data @/home/myuser/medium_dataset.dat \
482-
https://localhost:8443/axis2-json-api/services/BigDataH2Service
507+
https://localhost:8443/services/BigDataH2Service
483508
</pre>
484509

485510
<p>Where the contents of /home/myuser/medium_dataset.dat are:</p>
@@ -503,7 +528,7 @@ curl -v -H "Authorization: Bearer 95104Rn2I2oEATfuI90N" \
503528
-H "Content-Type: application/json" \
504529
-X POST \
505530
--data @/home/myuser/large_dataset.dat \
506-
https://localhost:8443/axis2-json-api/services/BigDataH2Service
531+
https://localhost:8443/services/BigDataH2Service
507532
</pre>
508533

509534
<p>Where the contents of /home/myuser/large_dataset.dat are:</p>

src/site/xdoc/docs/json-springboot-userguide.xml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,24 @@ the <b>"modules/samples/userguide/src/springbootdemo"</b> directory of <a
131131
href="../download.cgi">Axis2 standard binary
132132
distribution</a>.</p>
133133
<p>
134-
This quide supplies a pom.xml for building an exploded WAR with Spring Boot 3 -
135-
however this WAR does not have an embedded web server such as Tomcat.
134+
This guide supplies a pom.xml for building an exploded WAR with Spring Boot 3
135+
this WAR does not have an embedded web server and must be deployed to an external application server.
136136
</p>
137137
<p>
138-
The testing was carried out on Wildfly 32 with Jakarta, by installing the WAR in its app server.
138+
The testing was carried out on WildFly 32 with Jakarta, by installing the WAR in its app server.
139+
For the equivalent guide targeting Apache Tomcat 11, see the
140+
<a href="json-springboot-tomcat11-userguide.html">Tomcat 11 User's Guide</a>.
141+
The key differences between the two deployments are:
139142
</p>
143+
<ul>
144+
<li><strong>Context root:</strong> On WildFly the WAR name becomes the context root (<code>/axis2-json-api</code>);
145+
on Tomcat 11 (ROOT deployment) the context root is <code>/</code> and service URLs omit the <code>/axis2-json-api</code> prefix.</li>
146+
<li><strong>Deploy trigger:</strong> WildFly requires a <code>.dodeploy</code> marker file; Tomcat uses <code>cp -r</code> to <code>webapps/ROOT/</code>.</li>
147+
<li><strong>WildFly-specific files:</strong> <code>jboss-deployment-structure.xml</code> and <code>jboss-web.xml</code> are required here but absent from the Tomcat variant.</li>
148+
<li><strong>DataSource auto-config:</strong> WildFly suppresses Spring Boot's DataSource auto-configuration automatically;
149+
Tomcat requires explicit exclusion in <code>@SpringBootApplication</code>.</li>
150+
<li><strong>JSON request format:</strong> Identical for both — <code>{"methodName":[{"paramName":{...}}]}</code>.</li>
151+
</ul>
140152
<p>Please deploy the result of the maven build via 'mvn clean install', axis2-json-api.war, into your servlet container and ensure that it installs without any errors.</p>
141153

142154
<h2>Creating secure Web Services</h2>

0 commit comments

Comments
 (0)