You must remove or replace WebLogic-specific naming properties used when getting the IntialContext in your application.
The migration tool scans Java, XML, and properties files for the property values:
weblogic.jndi.WLInitialContextFactory, t3://.* and t3s://*.
For example, if an application specifies the following properties, the tool would flag the red text:
When moving your application to Liberty, do not specify an initial context factory or
a provider URL in the properties passed to the InitialContext constructor.
Use the empty constructor unless other naming properties are being set.
The following example illustrates application code that this rule will mark when migrating to Liberty:
Manually remove the unnecessary properties:
In addition to flagging java files, the tool will flag xml files containing WebLogic
property values. For Liberty, the properties should be removed in order to use the default
InitialContext initialization values.
In addition to flagging java and xml files, the tool will flag property files containing WebLogic property values. For Liberty, the properties should be removed.
When migrating to WebSphere Application Server traditional, the same WebLogic properties mentioned earlier will be flagged. An automated fix will be provided for Java files that changes the WebLogic naming property values to ones that work in WebSphere Application Server traditional:
The following example illustrates application code that this rule will flag when migrating to WebSphere Application Server traditional:
Using the same example shown earlier, after running the automated fix for WebSphere Application Server traditional, the code will be migrated as shown:
Note: The automated fix will use the default bootstrap port, 2809, for all t3 URLs, including the SSL 't3s://' URLs. Check your server settings to make sure that the correct port is used for each URL. For additional information, refer to the Port Number Settings for WebSphere Application Server traditional article.
Another option when moving to WebSphere Application Server traditional is removing the
properties and using the empty InitialContext() constructor.
Warning: The automated fix will only adjusts literals. If a URL is being built using variables, it will have to be manually migrated.
Variable example before:
Notice that the string variable port was not changed. Be sure that all such variables are migrated.
The following example illustrates similar changes applied to XML code.
XML code before :While the migration tool checks properties files, naming factory and provider properties are not migrated by an automated fix. For WebSphere Application Server traditional, either remove the properties or change them to the WebSphere naming property values.
See also the Use portable JNDI property values rule.