Sunday, May 11, 2014

How to use eclipse to develop liberty java application to BlueMix Part Two

Before you begin, make sure you have installed the Liberty and BlueMix plug-in in the  previous blog.

1.Create a HelloWorld Web project from Eclipse and make sure you have choose the traget runtime with was liberty profile.

2.Create a servlet named  HelloWolrd ,and generate get and set method.Write the below code to the doGet method.

     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        PrintWriter p = response.getWriter();
        p.println("<H2>This a blueMix demo");

3.Start the WebSphere Application Server Liberty Profile at localhost ,choose the server and add your hellow world project to the runtime server,so you can do the local testing for that.

Notes:Sometimes your liberty default 9080 might be occupied,so you might need to change httpPort in the server.xml

<server description="new server">

    <!-- Enable features -->

    <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
    <httpEndpoint httpPort="9085" httpsPort="9443" id="defaultHttpEndpoint"/>

    <applicationMonitor updateTrigger="mbean"/>

    <webApplication id="HelloWorld" location="HelloWorld.war" name="HelloWorld"/>

 4. Launch the url in the web console ,open the browser to do the testing

5.Once you liberty application is ready on local side, you can deploy it to the BlueMix,The step is very simple.Choose the IBM  BlueMix server and add your project into it.
6.During the deployment,it will let you change the application detail info,deployment detail,service selection info.

Pls make sure the deploy url is not used by others,otherwise the deployment will be failed

If you don;t use other service,just click  to next.
If the deployment is sucessful,you can see your liberty application is already deployed in the BlueMix.

7.Visit the BlueMix url

Now our first HelloWorld Liberty demo is completed,enjoy it.


  1. Thanks for the information Very usefull.

  2. Thanks for sharing such informative post keep updating. Keep updating.
    Snap on our tags to know more about us.
    Web Design company in Hubli | web designing in Hubli | SEO company in Hubli

  3. This information really worth saying, i think you are master of the content and thank you so much sharing that valuable information and get new skills after refer that post. Websphere Training in Chennai

  4. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android Training in Chennai
    Ios Training in Chennai