1
votes

I have installed IBM Worklight 6.0 Studio - Enterprise edition. My workstation (Windows 7) has multiple network interfaces and therefore, multiple IP addresses. The default wlclient.properties file has a wlServerHost value of one of those ip addresses, but NOT the correct one for the localhost. Where does the worklight studio obtain the IP address from? (ie, what command or what code is it using to obtain the host address for the embedded WAS 8.5 Liberty Profile server?)

1

1 Answers

6
votes

When Worklight Studio is installed, it will configure the embedded Liberty server with the 'host name' set to 'localhost'.

With that, when you build and deploy your app, Studio will try to guess what is the current IP address so that your app running on an emulator or device can connect to the Liberty server (as 'localhost' wouldn't work).

In this case Worklight Studio will print the following message to the Worklight Console log when building/deploying an app:

FWLPL0010W: "localhost" was detected from the target server configuration. Using the primary IP address of the host machine, 192.168.1.102, to build the Worklight application(s). Consider using a fully qualified hostname (avoid using "localhost") or a valid IP address instead. The value can be modified by opening the configuration editor of Worklight Development Server from the "Servers" view.

When Studio does not guess the right IP address, you will have to manually set it; this can be done by going to Eclipse's 'Servers' view and double clicking the "Worklight Development Server [worklight]" entry:

enter image description here

And then set the 'host name' accordingly:

enter image description here

Once you have done that, the next time you build and deploy your app Studio will use this IP address instead and you will be able to confirm that by looking into the 'wlclient.properties' file.

I hope this helps.