January 6, 2015 | Written by: Ram Vennam
Share this post:
Bluemix is great because you can simply push your Java EE application (WAR or EAR) and select what services your application needs. You don’t have to worry about the server configuration because it’s generated for you by the Liberty buildpack. Ideally, you should write your application in such a way that this generated configuration works for your application. However, sometimes you may need to modify server.xml in the standard Liberty deployment because you need to:
- Enable a Liberty
<feature> that is not enabled by the generated server.xml
- Set a generic JVM argument in jvm.options.
- Provide a shared library that resides outside the WAR defined in your server.xml
For these cases and others, you will need to package your Liberty server and push the package to Bluemix instead of the WAR or EAR. This packaged zip file will include everything in
wlp/usr/servers/<yourservername>. It will contain the modified server.xml, your application and some other files.
To package this server issue this command:
And then, push the zip to Bluemix:
(The Bluemix Eclipse plug-in makes this even easier.)
To see the command line or the Eclipse method in action, I created a video showing how to modify server.xml, package this server, and push it to Bluemix. The documentation “Options for pushing Liberty applications” provides additional details. Enjoy! If you have questions or comments, please post them below.