Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Starting with IBM Bluemix with Liberty for Java and Watson

IBM Bluemix, not only known for cloud computing but also for various services it provides. Watson is one of such services. This post gives info about how to start with IBM Bluemix and create a smart chat bot with Watson. Also in the later posts, I’ll provide tutorials for integrating Watson IOT and Facebook Messenger via a Java web service. So, first thing first, to start using bluemix click on this (IBM Bluemix ) URL and sign for trial. A trial version will be enough for developing and testing a chat bot, also it comes with support too. Complete the registration process by verifying the email address.

Success_bluemixOn the first time signing in a pop-up will ask you to create an organisation and select a geographical region.


Then create a space for your development. Space is like creating an environment where resources and other configuration can be done.

Create_SpaceNow you are ready to develop an app on bluemix. Please note that the organisation and space created will be available in the same region in which they were created.

Developing Java application on Bluemix

To start with development we need to set up Java Application on bluemix. For Java application IBM provides Liberty for Java App, select it from the app catalogue.


After selecting Liberty for Java, a page similar to below screenshot will open. Enter the app name and domain if you are going to opt for a personalised domain name. And then click on create button.


On successful create, app overview page will be displayed with status running. From this page, you can manage the installed Java application. Now we need to setup connection to other services, in this case, it will be to Watson Conversation. Click on connections tab to proceed.



Then connection tab will show all the connections of the Java app to other services. It can be a connection to the database, analytics, IoT or Watson services. From here you can add connections to existing services or create a new service to connect. For the first time since we don’t have any other service created, we will click on connect new to create a connection to new service.


On clicking to connect to new services catalogue page will open. For this post, I’ll select Watson conversation service to add to Java application.


Give a name to the service for better identification of an instance of that service. Once you’re done click on create to proceed with the creation of the service.


On successful create you’ll be redirected to manage  Conversation page from here you can manage connection for the Conversation service and also launch the tool to train the conversation. Now click on Connection tab to connect the Java app.


On connection tab of Conversation, you can see the installed Java application. Select the Java app and click on connect.


For connection, it needs to restage the app. So to proceed to click on the restage app button of the pop-up.


After the connection to the Conversation is done, we need to create a tool for the offline development and for build and deployment of the Java app. To create toolchain go to the Java app overview page and click on enable button inside the Continuous delivery tile.


Select Git repos and select repository type as a clone to clone the Java app to git. Give the repository a name and then click on Create button to configure the toolchain.


A page similar to below screenshot will load on successful creation of toolchain. Click on git tile to see the Java project cloned on the git repository.


On git repository link you’ll be able to see the folder structure. In the repo, you ‘ll see manifest.yml file. Make sure that manifest.yml contains the service name of the connected service (in this case Conversation service).


So now the Java app setup on bluemix is completed. And also Conversation is connected to java app. Now we are ready to program the Java application to use the Conversation service. In the next post, I’ll show how to clone the project from Git repository to local and how to troubleshoot common errors while cloning.

This post first appeared on | Tutorials, Views And Help Guides, please read the originial post: here

Share the post

Starting with IBM Bluemix with Liberty for Java and Watson


Subscribe to | Tutorials, Views And Help Guides

Get updates delivered right to your inbox!

Thank you for your subscription