WebSphere Liberty profile JCA & CICS TG Series: Set up your Eclipse IDE for Liberty
This series of articles, WebSphere Application Server Liberty profile JCA and CICS TG, serve as a walk-through for application developers setting up a test/development environment for a JEE enterprise applications, with the intention of using the JCA feature to access CICS programs through the CICS Transaction Gateway ECI resource adapter. There will be step-by-step detail which may be too much for experienced users, but the aim is to provide a (famous last words) fool-proof guide to get up and running. More detailed technical issues, such as global transactions (including XA) will be addressed later in the series.
This article walks through the setting up of the Websphere Development Tooling within the Eclipse IDE, installing and starting the Liberty profile server within Eclipse, and getting started with the sample EJB application "Hello EJB World". The next article builds upon this environment, adding a JEE utility class commonly used to represent user data on JCA interactions with CICS, and a building-block used later in this series of articles.
The following software/release levels are used in this article to demonstrate the capability:
- Eclipse 4.3.2 for Java EE Developers (Kepler SR2)
CICS Transaction Gateway for z/OS V9.0
- CICS Transaction Gateway for Multiplatforms V9.0
The starting point is to have the Eclipse IDE started on your workstation, and for the purposes of matching the screen shots in this article, select the JEE persepctive.
Install the WebSphere Developer Tools
By installing the WebSphere Developer Tools, your Eclipse IDE will updated to include artefacts and options related to defining and running one or more Liberty profile servers for application development and test purposes.
Install the WebSphere Developer Tools by dragging Install icon from https://developer.ibm.com/wasdev/downloads/liberty-profile-using-eclipse/ to your Eclipse IDE.
Tip: The "drop zone" for installing such components on the Eclipse IDE is the area above the main editor view.
After some time... the following dialogue appears:
Click Confirm, then Accept license terms. Liberty components will now be downloaded and installed:
....This will take a few minutes. Restart Eclipse when prompted:
Define your development Liberty server for testing
Make sure you have selected the the JEE perspective, and can see the Servers view (Windows->Show view->Servers):
From within the Servers view ... right-click for the context menu, select New->Server, to create a new Liberty profile server.
Follow the steps in the wizard, which includes the option to download and install the WebSphere Application Server V8.5 Liberty Profile.
Click Next. On the 2nd New Server dialogue, click the link, "download or install", for the Install Runtime Environment wizard.
Select the "Download and install a new runtime environment from:" radio button, and then the Liberty Profile V220.127.116.11 Runtime option.
Select IBM WebSphere Application Server V18.104.22.168 Liberty Profile and click Next >.
On the Install Add-ons dialog, select at least the Java EE Connector Architecture (JCA) feature, and the EJB Sample in order to follow this series of articles. If you want to try out the new JCA or Admin Center packages make sure to select to add them from the Liberty repository.
Click Next>, accept the license..and click Next again.
Choose a target install folder. I created one "wlp-8553".. alongside my Eclipse kepler folder.
Click Finish, and the downloads will begin:
..after which, hopefully - you will be informed of a successful installation:
You are now returned to the New Server dialog:
..with the path to the newly installed server binaries pre-filled.
Click Next > and review the New Server / Liberty Profile Server dialogue:
Click Next > there doesn't seem to be much in the way choice here:
Click Finish. There is now have an entry for "WebSphere Application Server V8.5 Liberty Profile" in the Enterprise Explorer view, and in the Server view:
Expanding the Servers entry:
Start the server, and the console shows:
Launching EJBSample (WebSphere Application Server 22.214.171.124/wlp-1.0.6.cl50320140731-0257) on IBM J9 VM, version pwa6470_27-20131115_04 (en_GB)
[AUDIT ] CWWKE0001I: The server EJBSample has been launched.
[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9132/EJBApp/
[AUDIT ] CWWKZ0001I: Application EJBApp started in 0.286 seconds.
[AUDIT ] CWWKF0011I: The server EJBSample is ready to run a smarter planet.
Point the browser to http://localhost:9132/ to see:
Invoke the servlet for the EJBSample using the in-built web browser by double clicking on the link in the console log, http://localhost:9132/EJBApp/:
Congratulations! Your Eclipse JEE and Liberty application development and test environment is ready for action!
In the next article in this series, a JEE utility project is created in Eclipse containing common code used by the CICS TG product samples for JCA, and is a pre-req for the sample Enterprise Application we will later create to demonstrate the JCA feature in WebSphere Liberty.