Topic
  • 7 replies
  • Latest Post - ‏2012-12-06T05:26:19Z by pembertona
SystemAdmin
SystemAdmin
300 Posts

Pinned topic Relation worklight app - J2ee app - worklight.war not clear

‏2012-11-05T09:42:13Z |
Even after reading the Worklight 5 administration guide, I still do not clearly understand the relation between a Worklight app and J2ee apps on the application server.
In chapter 2.7 it says that Studio creates .war files, project- and environment-specific ones. But then, the worklight.properties file (inside the .war file) contains information like the context root ("publicWorkLightContext"), which I thought are specific for the worklight server, not the app. I thought that the point of having a worklight server is, that you can have multiple apps running on it. So why does each of them have a separate .war file that specifies a different context root ?
Is the idea that I install multiple worklight consoles with different context roots on the same Application server ?
If yes, what is the benefit of having multiple consoles ?
Is it true that one Worklight Project in Studio realates to exactly one App ?
In my installation of Liberty Profile, there is also a file "worklight.war". What is the role of that one ? Is it also environment-specific ?
  • SystemAdmin
    SystemAdmin
    300 Posts

    Re: Relation worklight app - J2ee app - worklight.war not clear

    ‏2012-11-11T07:04:58Z  
    Even after reading the Worklight 5 administration guide, I still do not clearly understand the relation between a Worklight app and J2ee apps on the application server.
    In chapter 2.7 it says that Studio creates .war files, project- and environment-specific ones. But then, the worklight.properties file (inside the .war file) contains information like the context root ("publicWorkLightContext"), which I thought are specific for the worklight server, not the app. I thought that the point of having a worklight server is, that you can have multiple apps running on it. So why does each of them have a separate .war file that specifies a different context root ?
    I think there is some terminology confusion here. The term "server" in Worklight maps to Worklight application. When you build and deploy a Worklight Application, the packaging mechanism consists of set of artifacts that include server library code, customizations and the adapter code. How these get separated out during deployment (for instance WebSphere has a concept of SharedLibraries for the Server code) is application server dependent.
    Is the idea that I install multiple worklight consoles with different context roots on the same Application server ?
    If yes, what is the benefit of having multiple consoles?
    Worklight at this time only supports deploying on Worklight Server per Application Server instance. One configuration option at this time is to be flexible on the context root configuration of this Worklight Server deployed as a web application archive.
    Is it true that one Worklight Project in Studio realates to exactly one App?
    Yes.. One project maps to one Web Application Archive (believe this is what is meant by App)
    In my installation of Liberty Profile, there is also a file "worklight.war". What is the role of that one ? Is it also environment-specific?
    When you install on Liberty, there is an empty Worklight Server deployed. This is used to validate the install procedure completed successfully (ie the user can then validate the install worked by accessing the console). When it is time to actually deploy, you would replace this web application (ie the WL Server) with your own web application.
  • SystemAdmin
    SystemAdmin
    300 Posts

    Re: Relation worklight app - J2ee app - worklight.war not clear

    ‏2012-11-12T13:50:41Z  
    Thanks for this reply.
    Assume I have 2 Apps, "SportsNews" and "BookTravel". By App I mean the thing that you install on your iphone.
    To develop these, you need 2 projects in WL studio: "SportsNewsProj" and "BookTravelProj". Each of them has 1 app in the /app folder, and potentially one or multiple adapters in the /adapters folder.
    Now it is not clear to me, how you can deploy these 2 projects to the same WAS Liberty app server. I have 2 different worklight.properties files. One in SportsNewsProj/server/conf and one in BookTravelProj/server/conf. I get 2 different .war files. Which one do I install on the WAS Liberty server ? What is the correct order of actions that in the end I have both applications and all adapters in the same WL Console ?
  • SystemAdmin
    SystemAdmin
    300 Posts

    Re: Relation worklight app - J2ee app - worklight.war not clear

    ‏2012-11-12T14:09:50Z  
    Thanks for this reply.
    Assume I have 2 Apps, "SportsNews" and "BookTravel". By App I mean the thing that you install on your iphone.
    To develop these, you need 2 projects in WL studio: "SportsNewsProj" and "BookTravelProj". Each of them has 1 app in the /app folder, and potentially one or multiple adapters in the /adapters folder.
    Now it is not clear to me, how you can deploy these 2 projects to the same WAS Liberty app server. I have 2 different worklight.properties files. One in SportsNewsProj/server/conf and one in BookTravelProj/server/conf. I get 2 different .war files. Which one do I install on the WAS Liberty server ? What is the correct order of actions that in the end I have both applications and all adapters in the same WL Console ?
    Daniel, this posts is great in walking you through the deployment of a Worklight app: https://www.ibm.com/developerworks/mydeveloperworks/blogs/worklight/entry/how_to_deploy_a_worklight_app_to_worklight_server_at_amazon_ec23?lang=en

    Granted, it is written for Amazon's EC2, but the WL server setup is exactly the same in my Liberty profile in Ubuntu.

    The gist of it is that you need to deploy both war files into your servers/worklightServer/dropins directory. It doesn't matter what order, they are independent of one another.

    Then you will need to upload your .wlapp files into your console. If you have an adapter, you should also upload it into the console.

    Take a look at that posting. Since it is pretty detail, anything I write here would be duplicating it. Post any follow ups you have.

    Ralph Pina
  • SystemAdmin
    SystemAdmin
    300 Posts

    Re: Relation worklight app - J2ee app - worklight.war not clear

    ‏2012-11-20T09:20:48Z  
    Daniel, this posts is great in walking you through the deployment of a Worklight app: https://www.ibm.com/developerworks/mydeveloperworks/blogs/worklight/entry/how_to_deploy_a_worklight_app_to_worklight_server_at_amazon_ec23?lang=en

    Granted, it is written for Amazon's EC2, but the WL server setup is exactly the same in my Liberty profile in Ubuntu.

    The gist of it is that you need to deploy both war files into your servers/worklightServer/dropins directory. It doesn't matter what order, they are independent of one another.

    Then you will need to upload your .wlapp files into your console. If you have an adapter, you should also upload it into the console.

    Take a look at that posting. Since it is pretty detail, anything I write here would be duplicating it. Post any follow ups you have.

    Ralph Pina
    Hi Ralph, thanks, this blog entry indeed gives a nice step-by-step instruction on how to deploy one application.
    But it does not explain how to deal with more than one app.
    You suggest to just deploy both war files, in my example SportsNews.war and BookTravel.war. If I set the context root to "worklight" in both cases, this creates a conflict from a J2EE point of view:
    Where should the URL http://myserver:8080/worklight/console go ? To SportsNews.war or BookTravel.war ?
    It will just randomly select one, but then, why should I deploy both war files, if only one is used ?

    I am sure it will somehow work in the end, but if I have 1 console, there should be 1 war file, not multiple. There should be at least some documentation on what strategy is the best practice.

    Reagards, Daniel
  • SystemAdmin
    SystemAdmin
    300 Posts

    Re: Relation worklight app - J2ee app - worklight.war not clear

    ‏2012-11-21T00:13:14Z  
    Hi Ralph, thanks, this blog entry indeed gives a nice step-by-step instruction on how to deploy one application.
    But it does not explain how to deal with more than one app.
    You suggest to just deploy both war files, in my example SportsNews.war and BookTravel.war. If I set the context root to "worklight" in both cases, this creates a conflict from a J2EE point of view:
    Where should the URL http://myserver:8080/worklight/console go ? To SportsNews.war or BookTravel.war ?
    It will just randomly select one, but then, why should I deploy both war files, if only one is used ?

    I am sure it will somehow work in the end, but if I have 1 console, there should be 1 war file, not multiple. There should be at least some documentation on what strategy is the best practice.

    Reagards, Daniel
    Daniel,

    You can have only one single project/server customization (.war file) per app server, but once it's there, you can use the Worklight console to deploy any number of Worklight applications/adapters. The limitation is that all of those applications/adapters must reside under the same Worklight project in the development environment (share same server customization).

    Barbara Hampson, Manager, IBM Worklight
  • SystemAdmin
    SystemAdmin
    300 Posts

    Re: Relation worklight app - J2ee app - worklight.war not clear

    ‏2012-11-28T08:13:26Z  
    Thanks for this answer.
  • pembertona
    pembertona
    1 Post

    Re: Relation worklight app - J2ee app - worklight.war not clear

    ‏2012-12-06T05:26:19Z  
    Daniel,

    You can have only one single project/server customization (.war file) per app server, but once it's there, you can use the Worklight console to deploy any number of Worklight applications/adapters. The limitation is that all of those applications/adapters must reside under the same Worklight project in the development environment (share same server customization).

    Barbara Hampson, Manager, IBM Worklight
    Agreed; thanks for the response, Barbara.

    I'm curious - do you mean that through the Worklight IDE-based deployments to the embedded container, you can essentially only deploy one .war at a time?

    Would there be an issue in deploying multiple worklight .wars to a full WAS stack (ie: Worklight EE) if you update contextPaths accordingly?

    Andy Pemberton
    www.andypemberton.com