Hi All,
I can came across a situation were i needed to push 2 wars. In which one war was a support to another.You can think of it as a service war and any other war deployed will depend on the services provided by these was.
Answer by SGormley (58) | Aug 08, 2014 at 08:51 AM
If you can deploy it to a Liberty Server on your own machine, you could then package the server and push that to Bluemix up as per the instructions here:
https://www.ng.bluemix.net/docs/#starters/liberty/index.html#optionsforpushinglibertyapplications
Look in the section "Liberty Servers" that describes how to get a package from your server.
I would follow this advise. Deploy both wars to one server. Package the server and push it to Bluemix.
Creating an ear file with both wars is also an option
Answer by Ram Vennam (2928) | Aug 08, 2014 at 09:41 AM
Any reasons for not running them as separate apps?
When i was pushing 1 war the buildpack runtime environment setup is done like it downloads jdks etc etc. And the same thing again happens when i want to push another war. So should i create two diff project and push them. I dont know what to do cant i push the another war into the same container
This is the design of Cloud Foundry (and thus Bluemix); each application gets its own container and runtime. Pushing the war files as two separate apps has some nice properties like being able to scale and update the components separately.
Another option for having one container for both wars is to package them inside an ear file.
http://docs.oracle.com/javaee/6/tutorial/doc/bnaby.html
Each war should have its own /context-root (append at the end or your app url), depending on how you packaged it
Answer by Amardeep Bhattal (43) | Sep 09, 2014 at 04:28 AM
In one of the associated answers : "This is the design of Cloud Foundry (and thus Bluemix); each application gets its own container and runtime."
It doesn't have to be that war's are pushed one at a time onto a different server. It's possible that an "app" is a number of co-operating wars (depends on what you consider your app to be). I'd also like to be able to push multiple wars from a single directory. This would be a nice enhancement.
But as mentioned, the options for now are separate wars on separate server instances, package the wars in an ear file and push the ear, push a packaged server, or there is also the alternative to push from a server directory with the war's in Liberty's apps or dropins folder.
Thank for your response For now I have user packaged server to push multiple wars it worked fine.