Most classes in the weblogic.apache packages have been deprecated with instructions to use either org.apache classes or Java development kit (JDK) supplied XML parsers and transformers. This rule detects references to weblogic.apache packages. From the BEA WebLogic Server API Reference click each weblogic.apache package to get specific information on how each deprecated class should map to its replacement.
SolutionsMost of the weblogic.apache.xerces packages indicate that the JDK-supplied XML parsers and transformers should be used instead of the deprecated APIs.
WebLogicConsider a simple DOMParser example without the try/catch logic. In WebLogic, the code snippet code might look like the following example:
The best practices approach for WebSphere Application Server traditional or Liberty is to use the JAXP Java APIs instead of the weblogic.apache APIs. If you choose this approach, your code might look like the following example after manual migration.
If the weblogic.apache APIs are used extensively, the simplest application conversion approach is to use the automated fix when it becomes available which maps the weblogic.apache classes that are available in org.apache packages to the open source equivalent.
When the automated fix becomes available and it is applied, the Apache code must be downloaded and included in the application build path for the application to be compiled. The required Java archive (JAR) files are in the Apache Xerces Java XML Parser project. Most of the APIs are found in xercesImpl.jar and serializer.jar files. Follow your company's process for downloading and certifying this open source code.
Using open source, the migrated code resembles the following example: