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("<BODY>");
        p.println("<H2>This a blueMix demo");
        p.println("</BODY>");
    }

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 -->
    <featureManager>
        <feature>jsp-2.2</feature>
        <feature>localConnector-1.0</feature>
    </featureManager>

    <!-- 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"/>
</server>

 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 http://helloworld001.ng.bluemix.net/HelloWorld

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



10 comments:

  1. Thanks for the information Very usefull.

    ReplyDelete
  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

    ReplyDelete
  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

    ReplyDelete
  4. Thank you for sharing this powerful article, your explanation is clear and very easy to understand. Please kindly visit our site to get more information about IT solution.


    melbourne seo services

    ReplyDelete
  5. the blog is about How to use eclipse to develop liberty java application to BlueMix Part Two#java it is useful for students and Java Developers for more updates on java follow the link

    java Online Training Hyderabad

    ReplyDelete
  6. Really it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing..
    java course in delhi

    ReplyDelete
  7. Hi,

    Thanks for sharing a very interesting article about How to use eclipse to develop liberty java application to BlueMix Part Two. This is very useful information for online blog review readers. Keep it up such a nice posting like this.

    Regards,
    WondersMind,
    Web Design Company Bangalore

    ReplyDelete
  8. I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
    MCSE Training in chennai | mcse training class chennai


    ReplyDelete
  9. Your post is exceptionally useful to get some powerful tips to lessen weight appropriately. You have shared different pleasant photographs of the equivalent. I might want to thank you for sharing these tips. Definitely I will attempt this at home. Continue refreshing increasingly basic hints this way. making a contribution

    ReplyDelete