Migrating the HCL Commerce Version 9.1 code to Commerce+
com.ibm.commerce, and include only the code that is proprietary to your
organization.
Procedure
- Download the migration utility from IBM WebSphere.
- Extract or install the Open Liberty Migration Toolkit, following the migration tool instructions.
- Run the Open Liberty Migration Toolkit, pointing it to the location of your workspace.
- Review the tool’s output, a scan report that includes sections matching the table provided.
-
Use the following table, together with the report actions, to facilitate the code
migration.
Messages Required Action ThreadManagement classes com.ibm.commerce.threadmanagement.*this is changed tocom.hcl.commerce.threadmanagement.*The WebSphere Service Data Objects (SDO) APIs are unavailable Replacing Eclipse modeling framework service data objects with Eclipselink and the Java Persistence API Java API for XML-based RPC (JAX-RPC) is unavailable - Validate service calls:
- Test a few service calls related to the component you're working on.
- You can use request bodies from the Web Service Reference Page.
- Import the following projects into your workspace:
<Component>-Server.jar<Component>ServicesHTTPInterface.war
- Modify
<Component>ServicesHTTPInterface.war:- Update the servlet version level to
3.1in the following file:src/projects/<Component>ServicesHTTPInterface/.settings/org.eclipse.wst.common.project.facet.core.xml - Update the servlet name in
web.xmlto point to the service implementation class:com.ibm.commerce.<Component>.facade.server.<Component>ServicesImpl
- Update the servlet version level to
- Modify
<Component>-Server.jar:- Set EJB module level to
3.1:src/projects/<Component>-Server/.settings/org.eclipse.wst.common.project.facet.core.xml - Delete the following files and references:
-
JAX-RPCspecific mapping file:<Component>Services_mapping.xml -
version="1.2"fromejb-jar.xmlfiles (this caused issues with Open Liberty) -
pcbinding fromibm-webservices-bnd.xmi(keep only router mapping) -
ibm-webservices-ext.xmi -
webservices.xml(optional due to annotated port/service classes)
-
- Add or Modify the following:
- Create
jws-handler-chains.xmlto list handlers and map to the service. - Locate service code under:
com.ibm.commerce.<Component>.facade.server - Use the provided code skeleton to implement the service methods in
<Component>ServicesImpl.java - Annotate the class with
@HandlerChain, and replaceSOAPElementwithObject - Override
ComponentServicesPortType.javawith the provided version. - Copy
ObjectFactory.javainto the same package. - Update the MANIFEST.MF file
with:
Include-Scanning-Packages: com.ibm.commerce.<component>.facade.server - Ensure copyright comments are updated.
- Create
- Set EJB module level to
- Update
WC.ear:- Remove
<Component>-Server.jarfrom theIgnore-Scanning-Archiveslist in the manifest.
- Remove
CommonJ Timer and Work Manager APIs are unavailable on Liberty According to Examples to migrate to EE Concurrency, alternative interfaces can be used to migrate CommonJ work managers to Java EE concurrency utilities (such as ExecutorServiceandManagedExecutorService).The WAS Performance Monitoring Infrastructure (PMI) APIs and SPIs are unavailable If there is custom code or functionality that depends on PMI, you must remove it and adopt a Grafana-compatible solution instead. The WebSphere Servlet API was superseded by a newer implementation Classes in the Servlet API have changed, and this functionality is no longer provided. Reimplementation is required. The WebSphere logging and RAS APIs and SPIs are unavailable The following classes have been deprecated because they include WebSphere Application Server (WAS)-specific functionality that does not exist in Liberty. Any code that references these deprecated classes must be updated to use the new replacements.
- Deprecated Classes:
com.ibm.commerce.ras.WASLogcom.ibm.commerce.ras.WASTracecom.ibm.commerce.edp.utils.EDPLogcom.ibm.commerce.edp.utils.EDPTrace
- Replacement ClassesUse the following classes instead of the deprecated ones:
com.hcl.commerce.ras.WASLogcom.hcl.commerce.ras.WASTracecom.hcl.commerce.edp.utils.EDPLogcom.hcl.commerce.edp.utils.EDPTrace
WebSphere Asynch. Beans API was superseded by a newer implementation Use the same design approach that was adopted to replace the CommonJ Work Manager implementation. The WebSphere Common Exception APIs are unavailable Replace all instances of com.ibm.websphere.ce.cm.DuplicateKeyExceptionwithjava.sql.SQLIntegrityConstraintViolationExceptionGetting the server name on Liberty Replace com.ibm.websphere.runtime.ServerNamewithcom.hcl.commerce.common.utils.FoundationUtil.getTransactionServerName()The WSSecurityHelper revokeSSOCookies method is deprecated Replace WSSecurityHelper.revokeSSOCookies()withHttpServletRequest.logout()Missing dependency com.ibm.ws.cache.servlet - Use
com.hcl.commerce.pagelayout.cache.PageLayoutTagHelperinstead ofcom.ibm.commerce.pagelayout.cache.PageLayoutTagHelper - Use
com.ibm.websphere.servlet.cache.ServletCacheRequestto retrievecom.ibm.websphere.servlet.cache.FragmentInfoas an alternative tocom.ibm.ws.cache.servlet.FragmentInfo(previously found incom.ibm.websphere.appserver.api.webCache-1.1.65.jar)
Missing dependency com.ibm.bsf.BSFManager API Use org.apache.bsf.BSFManagerinstead ofcom.ibm.bsf.BSFManager. The replacement class can be found by adding the following Maven dependency:<dependency> <groupId>bsf</groupId> <artifactId>bsf</artifactId> <version>2.4.0</version> </dependency>Missing dependency com.ibm.misc.BASE64Encoder Use sun.misc.BASE64Encoderinstead ofcom.ibm.misc.BASE64EncoderMissing dependency com.ibm.ivj.ejb.runtime - Use
java.util.Hashtableinstead ofcom.ibm.ivj.ejb.runtime.AccessBeanHashtable. - Use
com.hcl.commerce.persistence.AccessBeanNullValueinstead ofcom.ibm.ivj.ejb.runtime.AccessBeanNullValue. - Use
com.ibm.commerce.persistence.AbstractJpaEntityAccessBeaninstead ofcom.ibm.ivj.ejb.runtime.AbstractEntityAccessBean.
Missing dependency com.ibm.vap APIs Use com.hcl.commerce.base.helpers.AbstractConverterinstead ofcom.ibm.vap.converters.VapAbstractConverterMissing dependency com.ibm.jsse and com.ibm.jsse2 APIs Use sun.security.provider.Suninstead ofcom.ibm.jsse2.IBMJSSEProvider2Remove the ComponentMetadata dependency Use com.hcl.commerce.foundation.server.services.dataaccess.db.ComponentBaseMetadatainstead ofcom.ibm.commerce.foundation.server.services.dataaccess.db.jdbc.ComponentMetadataSome WebSphere Security APIs and SPIs are unavailable When importing com.ibm.websphere.security.*, it can be found by using the Maven Open Liberty library:com.ibm.websphere.appserver.api.basics-1.2.16.jarReview use of the dynamic cache service Use com.ibm.wsspi.cache.web.CacheMonitorinstead ofcom.ibm.wsspi.cache.CacheMonitorThis class is available in the following Open Liberty Maven library:
com.ibm.websphere.appserver.spi.webCache-1.0.65.jarThe WebSphere Enterprise JavaBeans APIs and SPIs are unavailable These are mostly related to EJB code that has been deprecated. We are now using JPA instead of EJB CMPs.
Use the default InitialContext JNDI properties Use ctx = new javax.naming.InitialContext();instead ofctx = new javax.naming.InitialContext(jndiProperties);Transaction propagation is not supported for Enterprise JavaBeans (EJB) remote interfaces Removed references to <remote>for the affected EJBs.The WebSphere Management APIs and SPIs are unavailable - Use
com.hcl.commerce.base.helpers.BaseJDBCHelperinstead ofcom.ibm.commerce.base.helpers.BaseJDBCHelper - Use
com.hcl.commerce.base.objects.ECAbstractEntityBeaninstead ofcom.ibm.commerce.base.objects.ECAbstractEntityBean - Use
com.hcl.commerce.base.objects.ECEntityBeaninstead ofcom.ibm.commerce.base.objects.ECEntityBean
IBM JSON4J ClassNotFound The IBM json4j.jar file is deprecated. In Commerce+ the corresponding library is wink-json4j-1.4.jar. In previous Commerce versions, packages and classes such as org.apache.commons.json.* were located inside json4j.jar. Corresponding classes are now named org.apache.wink.json4j.*. Find and replace any references to the deprecated packages and classes. For example,
in JSON4J.jar becomesorg.apache.commons.json.JSONArray org.apache.commons.json.JSONObject
in the replacement Wink .jar file.org.apache.wink.json4j.JSONArray org.apache.wink.json4j.JSONObjectWhen building new customizations, refer to the new .jar file.
- Validate service calls: