Migrating 9.1 JSP stores to Commerce+ Transaction Server
Migrate custom downstream CRS extension repositories to Java 21, Spring 6, and Open Liberty 26+. Update Enterprise APIs to Jakarta EE and modernize your build toolchain.
Before you begin
- JDK 21 installed and available on your PATH environment variable.
- Access to your organization internal Maven repository URL to configure plugin and dependency resolution.
- Open Liberty 26+ base Docker image reference (the full image tag for your registry).
About this task
- Language level: Java 8 to JDK 21
- Enterprise APIs:
javax.servlet/javax.ejbtojakarta.servlet/jakarta.ejb - Spring Framework: 5.x to 6.x
- Application server: WebSphere Liberty to Open Liberty 26+
- Build toolchain: Maven dependency and plugin modernizationRemember: This guide documents the standard migration path and might not cover custom configurations specific to individual instances. Always validate changes against your target environment.
.agents/skills/migrate-crs-consumer-to-jdk21-spring6/SKILL.md. If
your IDE or toolchain supports agent skills, you can invoke it to perform these steps
automatically. The sections below describe the same transformations in human-readable
form for manual execution or review.Procedure
-
Migrate to the Jakarta EE namespace.
The
javaxenterprise packages have been moved to thejakartanamespace.Important: Do not replace base JDK packages such asjavax.crypto,javax.net.ssl, andjavax.xml. -
Update Spring Framework 6 APIs.
-
Update classes extending
HandlerInterceptorAdapterto implementHandlerInterceptor. -
Update import paths to
org.springframework.web.servlet.HandlerInterceptor. -
Remove superclass calls to interceptor methods
(
super.preHandle(),super.postHandle(),super.afterCompletion()). -
Update status code method calls for
HttpStatusCodecompatibility. ReplaceresponseEntity.getStatusCode().name()withHttpStatus.valueOf(responseEntity.getStatusCode().value()).name().
-
Update classes extending
-
Remap runtime paths and container configurations.
Update legacy WebSphere Liberty references (
/opt/WebSphere/Liberty) to Open Liberty paths (/opt/ol/wlp). -
Update WebSphere Cache API references. If code imports internal WebSphere
caching classes directly, replace direct imports with reflection-based
access.
If your code directly imports internal WebSphere caching classes (
com.ibm.ws.cache.servlet.CacheProxyResponse,CacheProxyWriter,FragmentComposer), these are not available on public Maven repositories and must be accessed via reflection at runtime.Replace direct imports with a reflection-based pattern:
private static final Class<?> CACHE_PROXY_RESPONSE_CLASS; private static final Method GET_FRAGMENT_COMPOSER_METHOD; static { Class<?> cprClass = null; Method gfcMethod = null; try { cprClass = Class.forName("com.ibm.ws.cache.servlet.CacheProxyResponse"); gfcMethod = cprClass.getMethod("getFragmentComposer"); } catch (Exception e) { // Fallback or logging logic here } CACHE_PROXY_RESPONSE_CLASS = cprClass; GET_FRAGMENT_COMPOSER_METHOD = gfcMethod; } -
Update project facets and classpath configurations.
.classpath : Change
JavaSE-1.8container entries toJavaSE-21..settings/org.eclipse.wst.common.project.facet.core.xmlUpdate the Java facet:<installed facet="jst.java" version="21"/> -
Verify the migration.
Verification checklist: Run search checks across the project root to ensure zero legacy references remain, then perform a complete project build.
What to check Command Legacy enterprise API imports rg "import javax\.(servlet|ejb)" --glob "*.java"Old XML namespaces ( java.sun.com)rg "java\.sun\.com/xml/ns/javaee" --glob "*.xml"Old XML namespaces ( xmlns.jcp.org)rg "xmlns\.jcp\.org/xml/ns/javaee" --glob "*.xml"Legacy servlet references in JSPs rg "javax\.servlet" --glob "*.jsp" --glob "*.jspf"Old deployment paths rg "/opt/WebSphere/Liberty"Removed Spring utilities rg "HandlerInterceptorAdapter|getRawStatusCode" --glob "*.java"Old JRE facet rg "JavaSE-1\.8" --glob ".classpath"Build and compile the project: Once all verification checks pass, run your build compiler (such as Maven). If compilation fails, check the error log for unmappedjavaxreferences or Spring 6 API changes, resolve the issues, and rebuild the project. -
Automate the migration using the agent skill.
You can run an agent skill to automate this migration process. The skill is located at
.agents/skills/migrate-crs-consumer-to-jdk21-spring6/SKILL.md. The skill executes the same transformations described in this guide when invoked by an IDE or toolchain that supports agent skills. Before executing, the skill prompts you for environment-specific values, such as your Maven repository URL and Docker base image tag.