This is an automated email from the ASF dual-hosted git repository. robertlazarski pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git
commit a0b41f60ba5a5e8309431fe028faabb9154a1e01 Author: Robert Lazarski <[email protected]> AuthorDate: Mon Apr 6 17:13:36 2026 -1000 springbootdemo-tomcat11: fix Axis2 service loading, add FinancialBenchmarkService Axis2WebAppInitializer: set axis2.repository.path init parameter explicitly using WarBasedAxisConfigurator.PARAM_AXIS2_REPOSITORY_PATH. Without this, WarBasedAxisConfigurator.loadServices() silently fails to scan WEB-INF/services/ *.aar archives on WildFly (lazy AxisServlet init) and intermittently on Tomcat. getRealPath() is called eagerly at startup and the result passed as a servlet init parameter, bypassing the lazy/VFS timing issue in both containers. pom.xml: bump java.version 17 → 21; add FinancialBenchmarkService.aar to both the deploy/ and exploded/ antrun targets. finbench_resources/services.xml: new file declaring the three public operations (portfolioVariance, monteCarlo, scenarioAnalysis). Omits runtimeInfo, which is a private helper method in FinancialBenchmarkService and cannot be exposed as an Axis2 operation — declaring it caused "Bad Request" on every call because reflection cannot access private methods. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> --- .gitignore | 1 + .../userguide/springbootdemo-tomcat11/README.md | 103 ++- .../src/userguide/springbootdemo-tomcat11/pom.xml | 8 +- .../finbench_resources/services.xml | 53 ++ .../configuration/Axis2WebAppInitializer.java | 28 +- .../src/userguide/springbootdemo-wildfly/README.md | 152 ++++ .../pom.xml | 874 +++++++++++---------- .../src/main/webapp/WEB-INF/beans.xml | 14 + .../webapp/WEB-INF/jboss-deployment-structure.xml | 34 + .../src/main/webapp/WEB-INF/jboss-web.xml | 12 + 10 files changed, 801 insertions(+), 478 deletions(-) diff --git a/.gitignore b/.gitignore index 22fd17ec49..bd854acaf2 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ target /modules/tool/axis2-eclipse-codegen-plugin/lib /modules/tool/axis2-eclipse-service-plugin/META-INF /modules/tool/axis2-eclipse-service-plugin/lib +axis2-json-api*.log diff --git a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/README.md b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/README.md index 316a1f36db..51bcacfcd5 100644 --- a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/README.md +++ b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/README.md @@ -28,14 +28,18 @@ Tested with: **Tomcat 11.0.20** · **OpenJDK 21** · **Spring Boot 3.4.3** ## Services -| Service | Path | Auth | -|---------|------|------| -| `LoginService.login` | `POST /axis2-json-api/services/LoginService` | None (public) | -| `TestwsService.testws` | `POST /axis2-json-api/services/TestwsService` | Bearer token | -| `BigDataH2Service.processBigDataSet` | `POST /axis2-json-api/services/BigDataH2Service` | None (public) | -| OpenAPI spec (JSON) | `GET /axis2-json-api/openapi.json` | None | -| OpenAPI spec (YAML) | `GET /axis2-json-api/openapi.yaml` | None | -| Swagger UI | `GET /axis2-json-api/swagger-ui` | None | +| Service | Operation | Path | Auth | +|---------|-----------|------|------| +| `loginService` | `doLogin` | `POST /axis2-json-api/services/loginService` | None (public) | +| `testws` | `doTestws` | `POST /axis2-json-api/services/testws` | Bearer token | +| `BigDataH2Service` | `processBigDataSet` | `POST /axis2-json-api/services/BigDataH2Service` | Bearer token | +| `FinancialBenchmarkService` | `portfolioVariance` | `POST /axis2-json-api/services/FinancialBenchmarkService` | Bearer token | +| `FinancialBenchmarkService` | `monteCarlo` | `POST /axis2-json-api/services/FinancialBenchmarkService` | Bearer token | +| `FinancialBenchmarkService` | `scenarioAnalysis` | `POST /axis2-json-api/services/FinancialBenchmarkService` | Bearer token | +| OpenAPI spec (JSON) | — | `GET /axis2-json-api/openapi.json` | None | +| OpenAPI spec (YAML) | — | `GET /axis2-json-api/openapi.yaml` | None | +| Swagger UI | — | `GET /axis2-json-api/swagger-ui` | None | +| OpenAPI MCP | — | `GET /axis2-json-api/openapi-mcp.json` | None | --- @@ -86,47 +90,76 @@ curl http://localhost:8080/axis2-json-api/swagger-ui ### 2. Login (get Bearer token) ```bash -curl -s -X POST http://localhost:8080/axis2-json-api/services/LoginService \ +curl -s -X POST http://localhost:8080/axis2-json-api/services/loginService \ -H 'Content-Type: application/json' \ - -d '{"login":[{"request":{"email":"[email protected]","credentials":"password"}}]}' + -d '{"doLogin":[{"arg0":{"email":"[email protected]","credentials":"userguide"}}]}' ``` -Response: `{"loginResponse":{"token":"<JWT>","status":"OK"}}` +Response: `{"response":{"token":"<TOKEN>","uuid":"<UUID>","status":"OK"}}` -### 3. Call protected service +### 3. Call protected service (testws) + +`messagein` must pass ESAPI `SafeString` validation (`[A-Za-z0-9.,\-_ ]*` — no `+` or special +characters). ```bash -TOKEN="<JWT from step 2>" -curl -s -X POST http://localhost:8080/axis2-json-api/services/TestwsService \ +TOKEN="<token from step 2>" +curl -s -X POST http://localhost:8080/axis2-json-api/services/testws \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $TOKEN" \ - -d '{"testws":[{"request":{"name":"World"}}]}' + -d '{"doTestws":[{"arg0":{"messagein":"hello world"}}]}' ``` -### 4. Call public BigData service +### 4. Call BigData service -Required fields: `datasetId` (non-empty string) and `datasetSize` (bytes). Size determines -processing path: <10MB → standard, 10–50MB → multiplexing, >50MB → streaming. +`datasetSize` is in bytes. Size determines processing path: <10 MB → standard, +10–50 MB → multiplexing, >50 MB → streaming. Use at least 1 000 000 to get populated results. ```bash curl -s -X POST http://localhost:8080/axis2-json-api/services/BigDataH2Service \ -H 'Content-Type: application/json' \ - -d '{"processBigDataSet":[{"request":{"datasetId":"test-dataset-001","datasetSize":1048576}}]}' + -H "Authorization: Bearer $TOKEN" \ + -d '{"processBigDataSet":[{"arg0":{"datasetId":"test-001","datasetSize":1000000,"processingMode":"streaming","enableMemoryOptimization":true,"analyticsType":"summary"}}]}' ``` -Response includes `processedRecordCount`, `http2Optimized`, `memoryOptimized`, and (for <10MB -datasets) a `processedRecords` array. +Response includes `processedRecordCount`, `http2Optimized`, `memoryOptimized`, and a +`processedRecords` array. + +### 5. Financial Benchmark Service + +```bash +# Portfolio variance — O(n²) covariance matrix +curl -s -X POST http://localhost:8080/axis2-json-api/services/FinancialBenchmarkService \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $TOKEN" \ + -d '{"portfolioVariance":[{"arg0":{"nAssets":2,"weights":[0.6,0.4],"covarianceMatrix":[[0.04,0.006],[0.006,0.09]],"normalizeWeights":false,"nPeriodsPerYear":252}}]}' + +# Monte Carlo VaR — GBM simulation +curl -s -X POST http://localhost:8080/axis2-json-api/services/FinancialBenchmarkService \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $TOKEN" \ + -d '{"monteCarlo":[{"arg0":{"nSimulations":10000,"nPeriods":252,"initialValue":100.0,"expectedReturn":0.08,"volatility":0.20,"nPeriodsPerYear":252,"randomSeed":42}}]}' + +# Scenario analysis — probability-weighted expected return +curl -s -X POST http://localhost:8080/axis2-json-api/services/FinancialBenchmarkService \ + -H 'Content-Type: application/json' \ + -H "Authorization: Bearer $TOKEN" \ + -d '{"scenarioAnalysis":[{"arg0":{"assets":[{"assetId":1,"currentPrice":100.0,"positionSize":100,"scenarios":[{"price":120.0,"probability":0.3},{"price":100.0,"probability":0.5},{"price":75.0,"probability":0.2}]}],"useHashLookup":true,"probTolerance":0.001}}]}' +``` --- ## Axis2 JSON-RPC request format -The top-level key is the **operation name**, and the body is wrapped in an array: +The top-level key is the **operation name**, and the value is an array containing one object +whose key is the argument name (conventionally `arg0`) and whose value is the request POJO: ```json -{ "operationName": [{ "request": { ...fields... } }] } +{ "operationName": [{ "arg0": { ...fields... } }] } ``` +This is mandated by `JsonUtils.invokeServiceClass()` in the `axis2-json` module. + --- ## Architecture notes @@ -135,7 +168,12 @@ The top-level key is the **operation name**, and the body is wrapped in an array `SpringApplication.run()`. Spring Boot only provides configuration; Tomcat is the server. - **No `DispatcherServlet`** — `@GetMapping` annotations are dead code in this module. OpenAPI endpoints are served by `OpenApiServlet`, a plain `HttpServlet` registered directly in - `Axis2WebAppInitializer` at `/openapi.json`, `/openapi.yaml`, and `/swagger-ui`. + `Axis2WebAppInitializer` at `/openapi.json`, `/openapi.yaml`, `/swagger-ui`, and + `/openapi-mcp.json`. +- **Axis2 repository path** — `Axis2WebAppInitializer` explicitly sets the + `axis2.repository.path` servlet init parameter using `ServletContext.getRealPath("/WEB-INF")`. + This is required on both Tomcat and WildFly to ensure `WarBasedAxisConfigurator` finds the + `WEB-INF/services/*.aar` archives reliably, bypassing any VFS or lazy-init timing issues. - **OpenAPI module** — `axis2-openapi-<version>.jar` is copied to `WEB-INF/modules/openapi-<version>.mar` by the Maven build. It must be present for `GET /openapi.*` and `GET /swagger-ui` to work. @@ -144,14 +182,15 @@ The top-level key is the **operation name**, and the body is wrapped in an array --- -## Relationship to `springbootdemo` (WildFly) +## Relationship to `springbootdemo-wildfly` -`springbootdemo-tomcat11` is derived from `springbootdemo` (which targets WildFly). The two -modules share the same service logic but differ in: +`springbootdemo-tomcat11` and `springbootdemo-wildfly` share all Java source and resources +via `build-helper-maven-plugin`. The only differences are container-specific: -| Aspect | `springbootdemo` (WildFly) | `springbootdemo-tomcat11` | -|--------|---------------------------|--------------------------| -| Server | WildFly / embedded Undertow | Apache Tomcat 11 | +| Aspect | `springbootdemo-tomcat11` | `springbootdemo-wildfly` | +|--------|--------------------------|--------------------------| +| Server | Apache Tomcat 11 | WildFly 32+ (Undertow) | +| Tested on | Tomcat 11.0.20 / Java 21 | WildFly 39 / Java 25 | +| WAR output | `target/deploy/axis2-json-api/` (no `.war` suffix) | `target/deploy/axis2-json-api/` | +| Extra WEB-INF files | — | `jboss-deployment-structure.xml`, `jboss-web.xml`, `beans.xml` | | Context path | `/axis2-json-api` | `/axis2-json-api` | -| OpenAPI routing | `OpenApiServlet` via `Axis2WebAppInitializer` | Same | -| H2 BigData service | Yes | Yes | diff --git a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/pom.xml b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/pom.xml index 614a1aa0dc..e3bf24c912 100644 --- a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/pom.xml +++ b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/pom.xml @@ -40,7 +40,7 @@ <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <java.version>17</java.version> + <java.version>21</java.version> <spring-boot.version>3.4.3</spring-boot.version> <axis2.version>2.0.1-SNAPSHOT</axis2.version> </properties> @@ -366,6 +366,9 @@ <jar jarfile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/services/BigDataH2Service.aar"> <metainf file="resources-axis2/bigdata_h2_resources/services.xml"/> </jar> + <jar jarfile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/services/FinancialBenchmarkService.aar"> + <metainf file="resources-axis2/finbench_resources/services.xml"/> + </jar> <copy todir="${project.build.directory}/deploy/axis2-json-api/WEB-INF/conf"> <fileset dir="resources-axis2/conf"> <include name="axis2.xml"/> @@ -385,6 +388,9 @@ <jar jarfile="${project.build.directory}/exploded/WEB-INF/services/BigDataH2Service.aar"> <metainf file="resources-axis2/bigdata_h2_resources/services.xml"/> </jar> + <jar jarfile="${project.build.directory}/exploded/WEB-INF/services/FinancialBenchmarkService.aar"> + <metainf file="resources-axis2/finbench_resources/services.xml"/> + </jar> <copy todir="${project.build.directory}/exploded/WEB-INF/conf"> <fileset dir="resources-axis2/conf"> <include name="axis2.xml"/> diff --git a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/resources-axis2/finbench_resources/services.xml b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/resources-axis2/finbench_resources/services.xml new file mode 100644 index 0000000000..23531be0b8 --- /dev/null +++ b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/resources-axis2/finbench_resources/services.xml @@ -0,0 +1,53 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<service name="FinancialBenchmarkService" scope="application"> + <description> + Financial Benchmark Service — portfolio variance, Monte Carlo VaR, scenario analysis. + Demonstrates compute-intensive JSON-RPC services accessible via MCP bridge. + </description> + <parameter name="ServiceClass">userguide.springboot.webservices.FinancialBenchmarkService</parameter> + <parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier</parameter> + <parameter name="SpringBeanName">financialBenchmarkService</parameter> + <parameter name="enableJSONOnly">true</parameter> + <parameter name="disableSOAP">true</parameter> + <operation name="portfolioVariance"> + <messageReceivers> + <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" + class="org.apache.axis2.json.moshi.rpc.JsonRpcMessageReceiver"/> + <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" + class="org.apache.axis2.json.moshi.rpc.JsonInOnlyRPCMessageReceiver"/> + </messageReceivers> + </operation> + <operation name="monteCarlo"> + <messageReceivers> + <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" + class="org.apache.axis2.json.moshi.rpc.JsonRpcMessageReceiver"/> + <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" + class="org.apache.axis2.json.moshi.rpc.JsonInOnlyRPCMessageReceiver"/> + </messageReceivers> + </operation> + <operation name="scenarioAnalysis"> + <messageReceivers> + <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" + class="org.apache.axis2.json.moshi.rpc.JsonRpcMessageReceiver"/> + <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" + class="org.apache.axis2.json.moshi.rpc.JsonInOnlyRPCMessageReceiver"/> + </messageReceivers> + </operation> +</service> diff --git a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/configuration/Axis2WebAppInitializer.java b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/configuration/Axis2WebAppInitializer.java index 2bae0d74fe..bc1f36ff2c 100644 --- a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/configuration/Axis2WebAppInitializer.java +++ b/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/src/main/java/userguide/springboot/configuration/Axis2WebAppInitializer.java @@ -21,10 +21,11 @@ package userguide.springboot.configuration; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.axis2.deployment.WarBasedAxisConfigurator; import org.apache.axis2.transport.http.AxisServlet; import org.springframework.boot.web.servlet.ServletContextInitializer; -import org.springframework.context.annotation.Configuration; -import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.core.annotation.Order; import org.springframework.beans.factory.annotation.Autowired; @@ -33,8 +34,8 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.PropertySource; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; -import jakarta.servlet.ServletContext; -import jakarta.servlet.ServletRegistration; +import jakarta.servlet.ServletContext; +import jakarta.servlet.ServletRegistration; import java.util.Set; @@ -69,12 +70,21 @@ public class Axis2WebAppInitializer implements ServletContextInitializer { ServletRegistration.Dynamic dispatcher = container.addServlet( "AxisServlet", new AxisServlet()); dispatcher.setLoadOnStartup(1); + + // Explicitly set the Axis2 repository path so WarBasedAxisConfigurator finds + // WEB-INF/services/*.aar on both Tomcat and WildFly (bypasses getRealPath() VFS issues). + String webInfPath = container.getRealPath("/WEB-INF"); + logger.warn("addAxis2Servlet: axis2.repository.path = " + webInfPath); + if (webInfPath != null) { + dispatcher.setInitParameter(WarBasedAxisConfigurator.PARAM_AXIS2_REPOSITORY_PATH, webInfPath); + } + Set<String> mappingConflicts = dispatcher.addMapping(SERVICES_MAPPING); - if (!mappingConflicts.isEmpty()) { - for (String s : mappingConflicts) { - logger.error("Mapping conflict: " + s); - } - throw new IllegalStateException("'AxisServlet' could not be mapped to '" + SERVICES_MAPPING + "'"); + if (!mappingConflicts.isEmpty()) { + for (String s : mappingConflicts) { + logger.error("Mapping conflict: " + s); + } + throw new IllegalStateException("'AxisServlet' could not be mapped to '" + SERVICES_MAPPING + "'"); } } diff --git a/modules/samples/userguide/src/userguide/springbootdemo-wildfly/README.md b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/README.md new file mode 100644 index 0000000000..c9b4870287 --- /dev/null +++ b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/README.md @@ -0,0 +1,152 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> + +# springbootdemo-wildfly + +Axis2 JSON-RPC services deployed as a WAR in **WildFly** (Undertow), using Spring Boot 3.x as +a configuration framework only — there is no embedded container. + +Tested with: **WildFly 39.0.1.Final** · **OpenJDK 25** · **Spring Boot 3.4.3** + +All Java source is shared from `../springbootdemo-tomcat11/src/main/java` via +`build-helper-maven-plugin`. This module only adds WildFly-specific WEB-INF descriptors. + +--- + +## WildFly-specific files + +| File | Purpose | +|------|---------| +| `src/main/webapp/WEB-INF/jboss-deployment-structure.xml` | Excludes conflicting WildFly subsystems (jaxrs, logging, jpa, cdi) and modules (log4j, slf4j, jboss-logging); adds `jdk.unsupported` dependency | +| `src/main/webapp/WEB-INF/jboss-web.xml` | Sets WildFly context root (defaults to `/axis2-json-api` from WAR name) | +| `src/main/webapp/WEB-INF/beans.xml` | `bean-discovery-mode="none"` — prevents Weld CDI from scanning Spring beans | + +--- + +## Services + +| Service | Operation | Path | Auth | +|---------|-----------|------|------| +| `loginService` | `doLogin` | `POST /axis2-json-api/services/loginService` | None (public) | +| `testws` | `doTestws` | `POST /axis2-json-api/services/testws` | Bearer token | +| `BigDataH2Service` | `processBigDataSet` | `POST /axis2-json-api/services/BigDataH2Service` | Bearer token | +| `FinancialBenchmarkService` | `portfolioVariance` | `POST /axis2-json-api/services/FinancialBenchmarkService` | Bearer token | +| `FinancialBenchmarkService` | `monteCarlo` | `POST /axis2-json-api/services/FinancialBenchmarkService` | Bearer token | +| `FinancialBenchmarkService` | `scenarioAnalysis` | `POST /axis2-json-api/services/FinancialBenchmarkService` | Bearer token | +| OpenAPI spec (JSON) | — | `GET /axis2-json-api/openapi.json` | None | +| OpenAPI spec (YAML) | — | `GET /axis2-json-api/openapi.yaml` | None | +| Swagger UI | — | `GET /axis2-json-api/swagger-ui` | None | +| OpenAPI MCP | — | `GET /axis2-json-api/openapi-mcp.json` | None | + +--- + +## Build + +```bash +cd modules/samples/userguide/src/userguide/springbootdemo-wildfly +mvn package -DskipTests +``` + +This produces an exploded WAR at `target/deploy/axis2-json-api/`. + +--- + +## Deploy to WildFly + +WildFly's deployment scanner treats a directory ending in `.war` as an exploded WAR. + +```bash +# Sync to the WildFly deployments directory (adjust path as needed) +rsync -a --delete target/deploy/axis2-json-api/ ~/wildfly/standalone/deployments/axis2-json-api.war/ + +# Trigger redeploy (WildFly hot-scans for this marker) +touch ~/wildfly/standalone/deployments/axis2-json-api.war.dodeploy +``` + +To undeploy first via the CLI (avoids stale classloader state on hot-redeploy): + +```bash +~/wildfly/bin/jboss-cli.sh --connect --command='/deployment=axis2-json-api.war:undeploy' +# then rsync + .dodeploy as above +``` + +### WildFly startup with Java 25 + +WildFly uses whatever `JAVA_HOME` is set when `standalone.sh` is launched. Set it before +starting: + +```bash +export JAVA_HOME=/usr/lib/jvm/java-25-openjdk-amd64 +export PATH=$JAVA_HOME/bin:$PATH +unset JAVA_OPTS # avoid -XX:+PrintFlagsFinal flooding jboss-cli.sh output +~/wildfly/bin/standalone.sh +``` + +--- + +## Known WildFly-specific behaviors + +### `loadOnStartup` is ignored for programmatic servlet registration + +WildFly / Undertow does **not** honour `setLoadOnStartup(1)` on servlets registered via +`ServletContextInitializer.addServlet()`. The AxisServlet initializes lazily on the first +request. This is normal — Axis2 service loading still works because +`Axis2WebAppInitializer` explicitly sets the `axis2.repository.path` init parameter (see +below). + +### `axis2.repository.path` must be set explicitly + +`WarBasedAxisConfigurator` normally locates `WEB-INF/services/*.aar` via +`ServletContext.getRealPath("/WEB-INF")`. On WildFly this can silently fail (VFS timing, +lazy init). `Axis2WebAppInitializer.addAxis2Servlet()` bypasses this by calling +`getRealPath()` eagerly at startup time and setting the `axis2.repository.path` servlet +init parameter directly. Without this, only some services load. + +### Excluded subsystems + +`jboss-deployment-structure.xml` excludes: + +- **jaxrs** — RESTEasy conflicts with Axis2 servlet dispatch +- **logging** — WildFly logging conflicts with bundled Log4j2 + log4j-jcl +- **jpa** — no `persistence.xml`; prevents WildFly JPA subsystem activation +- **bean-validation** — Spring handles its own validation +- **cdi** — prevents Weld from managing Spring beans + +### WildFly module upgrade notes + +When upgrading WildFly (e.g., 32 → 39), clear cached state before redeploying: + +```bash +rm -rf ~/wildfly/standalone/configuration/standalone_xml_history/ +rm -rf ~/wildfly/standalone/configuration/tmp/ +rm -f ~/wildfly/standalone/deployments/axis2-json-api.war.failed +rm -f ~/wildfly/standalone/deployments/axis2-json-api.war.deployed +``` + +The `axis2-json-api.war.failed` marker from an old WildFly version is **not** automatically +retried by a new WildFly instance — it must be removed. + +--- + +## Test flow + +See `../springbootdemo-tomcat11/README.md` for the full curl-based test sequence; it applies +identically to WildFly (same context path, same JSON-RPC format, same credentials). + +The only difference: use port `8080` on WildFly (same default as Tomcat 11). diff --git a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/pom.xml b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/pom.xml similarity index 69% copy from modules/samples/userguide/src/userguide/springbootdemo-tomcat11/pom.xml copy to modules/samples/userguide/src/userguide/springbootdemo-wildfly/pom.xml index 614a1aa0dc..d4f0d96c6f 100644 --- a/modules/samples/userguide/src/userguide/springbootdemo-tomcat11/pom.xml +++ b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/pom.xml @@ -1,436 +1,438 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - - <groupId>userguide.springboot</groupId> - <artifactId>axis2-json-api</artifactId> - <version>0.0.1-SNAPSHOT</version> - <packaging>war</packaging> - <name>axis2-json-api</name> - <description>Spring Boot with Axis2 demo</description> - - <parent> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-parent</artifactId> - <version>3.4.3</version> - <relativePath/> <!-- lookup parent from repository --> - </parent> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <java.version>17</java.version> - <spring-boot.version>3.4.3</spring-boot.version> - <axis2.version>2.0.1-SNAPSHOT</axis2.version> - </properties> - - <dependencies> - <dependency> - <groupId>org.springframework.boot</groupId> - <!-- Required in this userguide for - org.springframework.dao.DataAccessException - --> - <artifactId>spring-boot-starter-data-jpa</artifactId> - <exclusions> - <exclusion> - <groupId>com.zaxxer</groupId> - <artifactId>HikariCP</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>3.18.0</version> - </dependency> - <dependency> - <groupId>jakarta.activation</groupId> - <artifactId>jakarta.activation-api</artifactId> - <version>2.1.3</version> - </dependency> - <dependency> - <groupId>org.eclipse.angus</groupId> - <artifactId>angus-activation</artifactId> - <version>2.0.2</version> - </dependency> - <dependency> - <groupId>org.glassfish.jaxb</groupId> - <artifactId>jaxb-runtime</artifactId> - <version>4.0.3</version> - </dependency> - <dependency> - <groupId>org.glassfish.jaxb</groupId> - <artifactId>jaxb-xjc</artifactId> - <version>4.0.3</version> - </dependency> - <dependency> - <groupId>jakarta.xml.bind</groupId> - <artifactId>jakarta.xml.bind-api</artifactId> - <version>4.0.1</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-log4j2</artifactId> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-jul</artifactId> - <version>2.24.3</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-devtools</artifactId> - <scope>runtime</scope> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-collections4</artifactId> - <version>4.4</version> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-test</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-configuration-processor</artifactId> - <optional>true</optional> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-validation</artifactId> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter</artifactId> - <exclusions> - <exclusion> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>jakarta.servlet</groupId> - <artifactId>jakarta.servlet-api</artifactId> - <version>6.1.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.springframework.boot</groupId> - <artifactId>spring-boot-starter-security</artifactId> - <version>3.4.3</version> - </dependency> - <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <version>2.18.0</version> - </dependency> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> - <version>1.15</version> - </dependency> - <dependency> - <groupId>commons-validator</groupId> - <artifactId>commons-validator</artifactId> - <version>1.7</version> - </dependency> - <!-- axis2 --> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-fileupload2-core</artifactId> - <version>2.0.0-M2</version> - </dependency> - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-fileupload2-jakarta-servlet6</artifactId> - <version>2.0.0-M2</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-kernel</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-transport-http</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <!-- HTTP/2 Transport for Enterprise Big Data Processing --> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-transport-h2</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <!-- HTTP/2 Dependencies --> - <dependency> - <groupId>org.apache.httpcomponents.core5</groupId> - <artifactId>httpcore5-h2</artifactId> - <version>5.3.3</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-transport-local</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-json</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-ant-plugin</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-adb</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-java2wsdl</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-metadata</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-spring</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-jaxws</artifactId> - <version>2.0.1-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>org.apache.axis2</groupId> - <artifactId>axis2-openapi</artifactId> - <version>${axis2.version}</version> - </dependency> - <dependency> - <groupId>org.apache.neethi</groupId> - <artifactId>neethi</artifactId> - <version>3.2.1</version> - </dependency> - <dependency> - <groupId>wsdl4j</groupId> - <artifactId>wsdl4j</artifactId> - <version>1.6.3</version> - </dependency> - <dependency> - <groupId>org.codehaus.woodstox</groupId> - <artifactId>woodstox-core-asl</artifactId> - <version>4.4.1</version> - </dependency> - <dependency> - <groupId>org.apache.ws.xmlschema</groupId> - <artifactId>xmlschema-core</artifactId> - <version>2.3.0</version> - </dependency> - <dependency> - <groupId>org.codehaus.woodstox</groupId> - <artifactId>stax2-api</artifactId> - <version>4.2.1</version> - </dependency> - <dependency> - <groupId>org.apache.woden</groupId> - <artifactId>woden-core</artifactId> - <version>1.0M10</version> - </dependency> - <dependency> - <groupId>org.apache.ws.commons.axiom</groupId> - <artifactId>axiom-impl</artifactId> - <version>2.0.0</version> - </dependency> - <dependency> - <groupId>org.apache.ws.commons.axiom</groupId> - <artifactId>axiom-dom</artifactId> - <version>2.0.0</version> - </dependency> - <dependency> - <groupId>org.apache.ws.commons.axiom</groupId> - <artifactId>axiom-jakarta-activation</artifactId> - <version>2.0.0</version> - </dependency> - <dependency> - <groupId>org.apache.ws.commons.axiom</groupId> - <artifactId>axiom-legacy-attachments</artifactId> - <version>2.0.0</version> - </dependency> - <dependency> - <groupId>org.apache.ws.commons.axiom</groupId> - <artifactId>axiom-jakarta-jaxb</artifactId> - <version>2.0.0</version> - </dependency> - <dependency> - <groupId>javax.ws.rs</groupId> - <artifactId>jsr311-api</artifactId> - <version>1.1.1</version> - </dependency> - <dependency> - <groupId>org.owasp.esapi</groupId> - <artifactId>esapi</artifactId> - <version>2.6.0.0</version> - <classifier>jakarta</classifier> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents.core5</groupId> - <artifactId>httpcore5</artifactId> - <version>5.3.3</version> - </dependency> - <dependency> - <groupId>org.apache.httpcomponents.client5</groupId> - <artifactId>httpclient5</artifactId> - <version>5.4.3</version> - </dependency> - </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <version>3.8.1</version> - <executions> - <execution> - <id>unpack</id> - <phase>package</phase> - <goals> - <goal>unpack</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>userguide.springboot</groupId> - <artifactId>axis2-json-api</artifactId> - <version>0.0.1-SNAPSHOT</version> - <type>war</type> - <overWrite>false</overWrite> - <outputDirectory>${project.build.directory}/deploy/axis2-json-api</outputDirectory> - <includes>**/*.class,**/*.xml</includes> - <excludes>**/*test.class</excludes> - </artifactItem> - </artifactItems> - <includes>**/*.java</includes> - <excludes>**/*.properties</excludes> - <overWriteReleases>true</overWriteReleases> - <overWriteSnapshots>true</overWriteSnapshots> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-antrun-plugin</artifactId> - <version>3.1.0</version> - <executions> - <execution> - <id>install</id> - <phase>prepare-package</phase> - <configuration> - <target> - <jar jarfile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/services/Login.aar"> - <metainf file="resources-axis2/login_resources/services.xml"/> - </jar> - <jar jarfile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/services/testws.aar"> - <metainf file="resources-axis2/test_service_resources/services.xml"/> - </jar> - <jar jarfile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/services/BigDataH2Service.aar"> - <metainf file="resources-axis2/bigdata_h2_resources/services.xml"/> - </jar> - <copy todir="${project.build.directory}/deploy/axis2-json-api/WEB-INF/conf"> - <fileset dir="resources-axis2/conf"> - <include name="axis2.xml"/> - </fileset> - </copy> - <mkdir dir="${project.build.directory}/deploy/axis2-json-api/WEB-INF/modules"/> - <copy file="${settings.localRepository}/org/apache/axis2/axis2-openapi/${axis2.version}/axis2-openapi-${axis2.version}.jar" - tofile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/modules/openapi-${axis2.version}.mar" - overwrite="true"/> - <unzip src="${project.build.directory}/axis2-json-api-0.0.1-SNAPSHOT.war" dest="${project.build.directory}/exploded"/> - <jar jarfile="${project.build.directory}/exploded/WEB-INF/services/Login.aar"> - <metainf file="resources-axis2/login_resources/services.xml"/> - </jar> - <jar jarfile="${project.build.directory}/exploded/WEB-INF/services/testws.aar"> - <metainf file="resources-axis2/test_service_resources/services.xml"/> - </jar> - <jar jarfile="${project.build.directory}/exploded/WEB-INF/services/BigDataH2Service.aar"> - <metainf file="resources-axis2/bigdata_h2_resources/services.xml"/> - </jar> - <copy todir="${project.build.directory}/exploded/WEB-INF/conf"> - <fileset dir="resources-axis2/conf"> - <include name="axis2.xml"/> - </fileset> - </copy> - <mkdir dir="${project.build.directory}/exploded/WEB-INF/modules"/> - <copy file="${settings.localRepository}/org/apache/axis2/axis2-openapi/${axis2.version}/axis2-openapi-${axis2.version}.jar" - tofile="${project.build.directory}/exploded/WEB-INF/modules/openapi-${axis2.version}.mar" - overwrite="true"/> - </target> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-war-plugin</artifactId> - <version>3.4.0</version> - <configuration> - <webResources> - <resource> - <directory>src/main/resources</directory> - <includes> - <include>**/*.xml</include> - <include>**/application.properties</include> - </includes> - <targetPath>WEB-INF/classes</targetPath> - <filtering>true</filtering> - </resource> - </webResources> - <webappDirectory>${project.build.directory}/deploy/axis2-json-api</webappDirectory> - </configuration> - <executions> - <execution> - <id>enforce-java</id> - <goals> - <goal>exploded</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - - </build> - -</project> +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> + +<!-- + springbootdemo-wildfly — WildFly 32+ / Java 21+ deployment of the same + Spring Boot + Axis2 demo that springbootdemo-tomcat11 targets for Tomcat 11. + Tested on WildFly 39.0.1.Final / OpenJDK 25. + + Java source is shared from ../springbootdemo-tomcat11/src/main/java via + build-helper-maven-plugin. The only new artifacts here are: + src/main/webapp/WEB-INF/jboss-deployment-structure.xml + src/main/webapp/WEB-INF/jboss-web.xml + + Build: mvn package -f pom.xml + Deploy: cp target/axis2-json-api.war ~/wildfly/standalone/deployments/ +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>userguide.springboot</groupId> + <artifactId>axis2-json-api</artifactId> + <version>0.0.1-SNAPSHOT</version> + <packaging>war</packaging> + <name>axis2-json-api-wildfly</name> + <description>Spring Boot + Axis2 demo — WildFly 32+ / Java 21+ (tested on WildFly 39 / Java 25)</description> + + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>3.4.3</version> + <relativePath/> + </parent> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + <java.version>21</java.version> + <spring-boot.version>3.4.3</spring-boot.version> + <axis2.version>2.0.1-SNAPSHOT</axis2.version> + <!-- Shared source root — avoids duplicating 37 Java files --> + <tomcat11.src>${project.basedir}/../springbootdemo-tomcat11</tomcat11.src> + </properties> + + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-data-jpa</artifactId> + <exclusions> + <exclusion> + <groupId>com.zaxxer</groupId> + <artifactId>HikariCP</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>3.18.0</version> + </dependency> + <dependency> + <groupId>jakarta.activation</groupId> + <artifactId>jakarta.activation-api</artifactId> + <version>2.1.3</version> + </dependency> + <dependency> + <groupId>org.eclipse.angus</groupId> + <artifactId>angus-activation</artifactId> + <version>2.0.2</version> + </dependency> + <dependency> + <groupId>org.glassfish.jaxb</groupId> + <artifactId>jaxb-runtime</artifactId> + <version>4.0.3</version> + </dependency> + <dependency> + <groupId>org.glassfish.jaxb</groupId> + <artifactId>jaxb-xjc</artifactId> + <version>4.0.3</version> + </dependency> + <dependency> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + <version>4.0.1</version> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-log4j2</artifactId> + </dependency> + <dependency> + <groupId>org.apache.logging.log4j</groupId> + <artifactId>log4j-jul</artifactId> + <version>2.24.3</version> + </dependency> + <!-- No spring-boot-devtools: WildFly hot-reload works differently --> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-collections4</artifactId> + <version>4.4</version> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-test</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-configuration-processor</artifactId> + <optional>true</optional> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-validation</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + <exclusions> + <exclusion> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <!-- Servlet API is provided by WildFly (Undertow) --> + <dependency> + <groupId>jakarta.servlet</groupId> + <artifactId>jakarta.servlet-api</artifactId> + <version>6.0.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-security</artifactId> + <version>3.4.3</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.18.0</version> + </dependency> + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <version>1.15</version> + </dependency> + <dependency> + <groupId>commons-validator</groupId> + <artifactId>commons-validator</artifactId> + <version>1.7</version> + </dependency> + <!-- axis2 --> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-fileupload2-core</artifactId> + <version>2.0.0-M2</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-fileupload2-jakarta-servlet6</artifactId> + <version>2.0.0-M2</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-kernel</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-transport-http</artifactId> + <version>${axis2.version}</version> + </dependency> + <!-- HTTP/2 Transport for Enterprise Big Data Processing --> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-transport-h2</artifactId> + <version>${axis2.version}</version> + </dependency> + <!-- HTTP/2 Dependencies --> + <dependency> + <groupId>org.apache.httpcomponents.core5</groupId> + <artifactId>httpcore5-h2</artifactId> + <version>5.3.3</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-transport-local</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-json</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-ant-plugin</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-adb</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-java2wsdl</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-metadata</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-spring</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-jaxws</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.axis2</groupId> + <artifactId>axis2-openapi</artifactId> + <version>${axis2.version}</version> + </dependency> + <dependency> + <groupId>org.apache.neethi</groupId> + <artifactId>neethi</artifactId> + <version>3.2.1</version> + </dependency> + <dependency> + <groupId>wsdl4j</groupId> + <artifactId>wsdl4j</artifactId> + <version>1.6.3</version> + </dependency> + <dependency> + <groupId>org.codehaus.woodstox</groupId> + <artifactId>woodstox-core-asl</artifactId> + <version>4.4.1</version> + </dependency> + <dependency> + <groupId>org.apache.ws.xmlschema</groupId> + <artifactId>xmlschema-core</artifactId> + <version>2.3.0</version> + </dependency> + <dependency> + <groupId>org.codehaus.woodstox</groupId> + <artifactId>stax2-api</artifactId> + <version>4.2.1</version> + </dependency> + <dependency> + <groupId>org.apache.woden</groupId> + <artifactId>woden-core</artifactId> + <version>1.0M10</version> + </dependency> + <dependency> + <groupId>org.apache.ws.commons.axiom</groupId> + <artifactId>axiom-impl</artifactId> + <version>2.0.0</version> + </dependency> + <dependency> + <groupId>org.apache.ws.commons.axiom</groupId> + <artifactId>axiom-dom</artifactId> + <version>2.0.0</version> + </dependency> + <dependency> + <groupId>org.apache.ws.commons.axiom</groupId> + <artifactId>axiom-jakarta-activation</artifactId> + <version>2.0.0</version> + </dependency> + <dependency> + <groupId>org.apache.ws.commons.axiom</groupId> + <artifactId>axiom-legacy-attachments</artifactId> + <version>2.0.0</version> + </dependency> + <dependency> + <groupId>org.apache.ws.commons.axiom</groupId> + <artifactId>axiom-jakarta-jaxb</artifactId> + <version>2.0.0</version> + </dependency> + <dependency> + <groupId>javax.ws.rs</groupId> + <artifactId>jsr311-api</artifactId> + <version>1.1.1</version> + </dependency> + <dependency> + <groupId>org.owasp.esapi</groupId> + <artifactId>esapi</artifactId> + <version>2.6.0.0</version> + <classifier>jakarta</classifier> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents.core5</groupId> + <artifactId>httpcore5</artifactId> + <version>5.3.3</version> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents.client5</groupId> + <artifactId>httpclient5</artifactId> + <version>5.4.3</version> + </dependency> + </dependencies> + + <build> + <plugins> + <!-- + Share Java source and resources from springbootdemo-tomcat11. + No Java files live in this module — it only adds WildFly WEB-INF resources. + --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>3.6.0</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals><goal>add-source</goal></goals> + <configuration> + <sources> + <source>${tomcat11.src}/src/main/java</source> + </sources> + </configuration> + </execution> + <execution> + <id>add-resource</id> + <phase>generate-resources</phase> + <goals><goal>add-resource</goal></goals> + <configuration> + <resources> + <resource> + <directory>${tomcat11.src}/src/main/resources</directory> + </resource> + </resources> + </configuration> + </execution> + </executions> + </plugin> + +<plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>3.1.0</version> + <executions> + <execution> + <id>install</id> + <phase>prepare-package</phase> + <configuration> + <target> + <!-- .aar files reference resources-axis2 in the shared tomcat11 dir --> + <jar jarfile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/services/Login.aar"> + <metainf file="${tomcat11.src}/resources-axis2/login_resources/services.xml"/> + </jar> + <jar jarfile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/services/testws.aar"> + <metainf file="${tomcat11.src}/resources-axis2/test_service_resources/services.xml"/> + </jar> + <jar jarfile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/services/BigDataH2Service.aar"> + <metainf file="${tomcat11.src}/resources-axis2/bigdata_h2_resources/services.xml"/> + </jar> + <jar jarfile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/services/FinancialBenchmarkService.aar"> + <metainf file="${tomcat11.src}/resources-axis2/finbench_resources/services.xml"/> + </jar> + <copy todir="${project.build.directory}/deploy/axis2-json-api/WEB-INF/conf"> + <fileset dir="${tomcat11.src}/resources-axis2/conf"> + <include name="axis2.xml"/> + </fileset> + </copy> + <mkdir dir="${project.build.directory}/deploy/axis2-json-api/WEB-INF/modules"/> + <copy file="${settings.localRepository}/org/apache/axis2/axis2-openapi/${axis2.version}/axis2-openapi-${axis2.version}.jar" + tofile="${project.build.directory}/deploy/axis2-json-api/WEB-INF/modules/openapi-${axis2.version}.mar" + overwrite="true"/> + <!-- exploded/ view is produced by maven-war-plugin's exploded goal (package phase) --> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>3.4.0</version> + <configuration> + <!-- + src/main/webapp/WEB-INF/ contains jboss-deployment-structure.xml + and jboss-web.xml — picked up automatically from here. + --> + <webResources> + <resource> + <directory>${tomcat11.src}/src/main/resources</directory> + <includes> + <include>**/*.xml</include> + <include>**/application.properties</include> + </includes> + <targetPath>WEB-INF/classes</targetPath> + <filtering>true</filtering> + </resource> + </webResources> + <webappDirectory>${project.build.directory}/deploy/axis2-json-api</webappDirectory> + </configuration> + <executions> + <execution> + <id>enforce-java</id> + <goals> + <goal>exploded</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/modules/samples/userguide/src/userguide/springbootdemo-wildfly/src/main/webapp/WEB-INF/beans.xml b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 0000000000..602b1ca6cb --- /dev/null +++ b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + bean-discovery-mode="none" tells WildFly's Weld (CDI) that this archive + contains no CDI beans. Without this, WildFly 32 activates its global + hibernate-validator-cdi interceptor for the deployment, which fails because + there is no CDI Validator bean (Spring Boot handles validation itself). +--> +<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee + https://jakarta.ee/xml/ns/jakartaee/beans_4_0.xsd" + version="4.0" + bean-discovery-mode="none"> +</beans> diff --git a/modules/samples/userguide/src/userguide/springbootdemo-wildfly/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/src/main/webapp/WEB-INF/jboss-deployment-structure.xml new file mode 100644 index 0000000000..5a3d0eb6af --- /dev/null +++ b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -0,0 +1,34 @@ +<jboss-deployment-structure> + <deployment> + <exclude-subsystems> + <!-- RESTEasy conflicts with Spring MVC / Axis2 servlet dispatch --> + <subsystem name="jaxrs" /> + <!-- WildFly logging conflicts with our bundled Log4j2 + SLF4J --> + <subsystem name="logging" /> + <!-- No persistence.xml; prevent WildFly JPA subsystem from activating --> + <subsystem name="jpa" /> + <!-- Spring handles its own bean validation --> + <subsystem name="bean-validation" /> + <!-- Prevent Weld CDI from trying to manage Spring beans --> + <subsystem name="cdi" /> + </exclude-subsystems> + <exclusions> + <module name="org.apache.log4j" /> + <module name="org.apache.commons.logging" /> + <module name="org.jboss.logging" /> + <module name="org.jboss.logging.jul-to-slf4j-stub" /> + <module name="org.jboss.logmanager" /> + <module name="org.jboss.logmanager.log4j" /> + <module name="org.slf4j" /> + <module name="org.slf4j.impl" /> + <!-- Prevent WildFly's hibernate-validator-cdi interceptor from activating; + its ValidationInterceptor needs an @Inject Validator that doesn't exist + in a Spring Boot deployment. Spring handles bean validation itself. --> + <module name="org.hibernate.validator.cdi" /> + </exclusions> + <dependencies> + <!-- Required by some Axis2 internals that use sun.misc.Unsafe --> + <module name="jdk.unsupported" slot="main" export="true" /> + </dependencies> + </deployment> +</jboss-deployment-structure> diff --git a/modules/samples/userguide/src/userguide/springbootdemo-wildfly/src/main/webapp/WEB-INF/jboss-web.xml b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/src/main/webapp/WEB-INF/jboss-web.xml new file mode 100644 index 0000000000..65a7106443 --- /dev/null +++ b/modules/samples/userguide/src/userguide/springbootdemo-wildfly/src/main/webapp/WEB-INF/jboss-web.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!DOCTYPE jboss-web PUBLIC + "-//JBoss//DTD Web Application 5.0//EN" + "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd"> +<!-- + Context root for WildFly deployment. + WAR filename (axis2-json-api.war) sets the context to /axis2-json-api by default. + Uncomment <context-root> below to override (e.g. to deploy as root context). +--> +<jboss-web> + <!-- <context-root>/</context-root> --> +</jboss-web>
