You must remove or replace JBoss-specific naming properties used when getting the IntialContext in your application.
The migration tool scans Java and properties files for the property values:
org.jnp.interfaces.NamingContextFactory, jnp://.* and org.jboss.naming.*.
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 an empty constructor unless other naming properties are being set.
The following example illustrates application code that this rule will flag when migrating to Liberty:
For Liberty, manually remove the unnecessary properties:
In addition to flagging java files, the tool will flag property files for the JBoss specific properties listed earlier. For Liberty, remove these properties from the file.
When migrating to WebSphere Application Server traditional, the same JBoss properties mentioned earlier will be flagged. An automated fix will flagged Java files that changes the JBoss naming property values to the values 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 example shown earlier, the code will be migrated as shown:
Another option when moving to WebSphere Application Server traditional is removing the properties and using the empty InitialContext() constructor.
When provided the automated fix will only be applied when the org.jboss.naming is specified with no trailing string
as shown in the preceding example. If the org.jboss.naming value is followed by an additional string, the rule will flag the value.
For example, this property will be flagged:
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces.
In addition to flagging java files, the tool will flag property files for the JBoss specific properties listed earlier. For WebSphere Application Server traditional, manually remove these properties from the file or change them to the WebSphere naming property values.