Search code examples
ibm-mobilefirstworklight-adaptersworklight-server

IBM Worklight - load a properties file from an adapter


I need to access some properties from a Javascript adapter. I know that i can access to worklight.properties file using

WL.Server.configuration.propertyName

but seems that when the property file change a server restart is needed

From Eclipse console after saving a new version of worklight.properties:

[AUDIT   ] CWWKG0016I: Starting server configuration update.
[AUDIT   ] CWWKG0017I: The server configuration was successfully updated in 0.005 seconds.
[AUDIT   ] CWWKT0017I: Web application removed (default_host): http://hostname:hostport/ProjectName/
[AUDIT   ] CWWKZ0009I: The application ProjectName has stopped successfully.
[AUDIT   ] CWWKG0016I: Starting server configuration update.
[AUDIT   ] CWWKG0017I: The server configuration was successfully updated in 0.007 seconds.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://hostname:hostport/ProjectName/
[AUDIT   ] CWWKZ0001I: Application ProjectName started in 1.868 seconds.

There is a way to avoid server restart, or use a different WL mechanism to read Server side properties?

My env:

Eclipse Java EE IDE for Web Developers. Version: Kepler Service Release 2

IBM Worklight Studio 6.1


Solution

  • In your question you do not explain why this server restart bothers you.

    In the development environment - the Worklight Studio plug-in for Eclipse, what you say is correct - whenever you change any file that resides in the server folder of your Worklight project, the embedded WAS Liberty profile server will restart.

    This is the expected behavior and is unavoidable.
    In addition, there is no other mechanism AFAIK to read server properties.