Quantcast
Channel: The Middleware Shop » Liberty Profile
Viewing all 13 articles
Browse latest View live

Command Line Install of IBM Installation Manager

$
0
0

Installing an IBM product using the IBM Installation Manager

To install a product such as WebSphere Application Server 8.5.5.5 Liberty Profile we first need to install IBM Installation Manager (IM). WAS 8.5.5 required a minimum of IM version 1.6.2, but below I have chosen to use the latest version of IBM Installation Manager which we can locate via this main IM support landing page, mentioned in the next section

You can get the PDF version here: Command line install for IBM Installation Manager

Installing Installation Manager

Most of the core reference documentation can be located at dedicated support URLs for any given product, or you can refer to the product sections of the IBM Knowledge Centre. IBM has improved and restricted its support documentation presentation. In fact, it is really good now and much easier to navigate around than ever before.

I have recently noticed, that most IBM products now have a dedicated support landing page. An example is the URL below, which is the main support page for IBM Installation Manager.

http://www-01.ibm.com/support/docview.wss?uid=swg27025142

Also on this page we also find the download for the IBM Packaging Utility, which we will cover later in this guide, where we explain how you can use a web source to acquire the files required for your installation and have then downloaded into a local repository that IM can access.

 

  • Click on the link Download Document to navigate to the download landing page.

  • Click on the FC link to navigate to Fix Central location

Select the Installer that’s meets your operating system, I have chosen the Linux X86_64 as I am using CentOS 7 as my preferred OS. Now CentOS 7 is not a supported platform, so please refer to the Appendix to add the required dependencies to ensure that IM will install and also run.

  • Select the download and click Continue

You will be presented with a page that will launch the IBM Download Manager which will manage the download.

 

  • Click Download Now

The IBM Download Manager will launch and the file called agent.installer.linux.gtk.x86_64_1.8.1000.20141126_2002.zip will be downloaded.

 

Copy the zip file to your appropriate installation store on your Linux Server/Desktop

 

I unpacked the zip file using the CentOS unzip command into a folder called /var/apps/installs/IM1.8.1

But you can use whatever standard that is appropriate to your requirements. Typically organizations have a standard approach to manageable/extendable virtual file-systems

Now that you have the installation kit expanded, you will need to choose the syntax, depending on the security requirements of your Linux OS.

Administrator Non Administrator Group
./installc -log log_file -acceptLicense ./userinstc -log log_file -acceptLicense ./groupinstc -dataLocation application_data_location -log log_file -acceptLicense

Note: The -dataLocation option is required for group mode when you install Installation Manager. The installed instance of Installation Manager uses the stored location each time you start Installation Manager. This stored location was specified by the -dataLocation option during the installation. You do not need to use the -datalocation option to start Installation Manager in group mode.

Use the -installationDirectory directory option to specify a non-default installation directory. For Group mode, specify a directory as described in Group mode roadmaps and silent installations.

An example syntax is displayed below

  • Run the required installc command as root. (We are using a root user in this document).
./installc -log ./logs/im_1.8.1_install_log.xml -acceptLicense

This command installs and logs to a file called /im_1.8.1_install_log.xml in a logs folder within the installation kit directory.

Result:

Installed com.ibm.cic.agent_1.8.1000.20141126_2002 to the /opt/IBM/InstallationManager/eclipse directory.

 

I often to a quick cat of the logs to ensure not errors are logged. See an example below.

cat logs/im_1.8.1_install_log.xml

Generally a successful installation of IM will create the following example log contents in the log file

[root@localhost IM1.8.1]# cat logs/im_1.8.1_install_log.xml
<?xml version=’1.0′ encoding=’UTF-8’?>

<result/>

 

Now since we have used root, we presume that this is allowed by the system admins. Often organizations, will lock down the OS and you will have to either have sudo rights, or use a predefined non admin account/group. For example wasadmin:wasadmin or equivalent.

If you have a Linux desktop ie XSession capability, I would not try and run the IM as a GUI, but there is no need if you have no desktop.

Example of verifying the running of IM as a GUI

We have now completed the installation of IBM Installation Manager, now we can install WAS silently etc.

In the modern world of 2015, I must say I am impressed by IBMs new approach to Knowledge access. Their new Knowledge Centre design is awesome to say the least!, Useful and the search works. Must because Lotus/Domino is not used! It is a wicked new upgrade to accessing information and I am very happy. Everyone knows how hard I am to please when it comes to IBM LOL. I think this is what we have been looking for as Middleware professionals using IBMs products.


core.feature feature cannot be found in package – CRIMA1151E

$
0
0

CRIMA1151E ERROR: The “core.feature” feature cannot be found in package

While running a command line install of WebSphere Liberty Profile 8.5.5, we get the following error reported by IBM Installation Manager.

[root@localhost tools]# ./imcl install com.ibm.websphere.liberty.BASE.v85_8.5.5000.20130514_1313,core.feature,liberty,com.ibm.sdk.6_64bit -installationDirectory /var/apps/was8.5.5_LP -sharedResourcesDirectory /var/IM/im-shared -repositories /var/apps/installs/WAS_Liberty_8.5.5 -acceptLicense -showProgress -log /var/log/ibm/install/was8.5.5_LP.xml -preferences com.ibm.cic.common.core.preferences.keepFetchedFiles=false,com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts=false

CRIMA1151E ERROR: The “core.feature” feature cannot be found in package com.ibm.websphere.liberty.BASE.v85 (IBM WebSphere Application Server Liberty 8.5.5.0).

Reason:

This error occurs when you are using a WAS 8.5.5 Liberty Profile download, and so since you do not have a full version of WAS as well, you cannot install the core feature, so remove this element and re-issue the silent imcl command line.

CWWKE0701E: com.ibm.ws.security.AccessIdUtil

$
0
0

CWWKE0701E: com.ibm.ws.security.AccessIdUtil

Error occurs when modifying server.xml of a Liberty Profile Runtime server 8.5.5.4. We have a server, and we have modified the server.xml with a new feature, the console.log reports the following output:

[AUDIT ] CWWKG0016I: Starting server configuration update.

[ERROR ] CWWKS0005E: A configuration exception has occurred. No available userRegistry service.

[ERROR ] CWWKE0701E: [com.ibm.ws.security.AccessIdUtil(179)] The activate method has thrown an exception Bundle:com.ibm.ws.security(id=90) java.lang.IllegalStateException: CWWKS0005E: A configuration exception has occurred. No available userRegistry service.

at com.ibm.ws.security.internal.SecurityServiceImpl.autoDetectService(SecurityServiceImpl.java:340)

at [internal classes]

 

[ERROR ] CWWKE0701E: [com.ibm.ws.security.AccessIdUtil(179)] Failed creating the component instance; see log for reason Bundle:com.ibm.ws.security(id=90)

[AUDIT ] CWWKG0017I: The server configuration was successfully updated in 8.252 seconds.

[AUDIT ] CWWKF0012I: The server installed the following features: [ssl-1.0, json-1.0, restConnector-1.0, adminCenter-1.0, jaxrs-1.1, jndi-1.0, distributedMap-1.0].

[AUDIT ] CWWKF0008I: Feature update completed in 8.340 seconds.

[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/IBMJMXConnectorREST/

[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/ibm/api/

[AUDIT ] CWWKS4104A: LTPA keys created in 4.057 seconds. LTPA key file: /var/apps/was8.5.5.2_LP/wlp/usr/servers/server1/resources/security/ltpa.keys

[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/ibm/adminCenter/explore-1.0/

[AUDIT ] CWWKT0016I: Web application available (default_host): http://localhost:9080/adminCenter/

Note: The features being added was the new Admin Center, but it is not related to this error as such.

After some research I found a document on IBM:

PI31809: CWWKE0701E WHEN SECURITY ID VALUE IS NULL

http://www-01.ibm.com/support/docview.wss?uid=swg1PI31809

This is a code error, and will be fixed in Liberty Profile Runtime version 8.5.5.5

CWWKS9113E: The SSL port is not active

$
0
0

Error when trying to log into the Liberty Profile Admin Center

[ERROR ] CWWKS9113E: The SSL port is not active. The incoming http request cannot be redirected to a secure port. Check the server.xml file for configuration errors. The https port may be disabled. The keyStore element may be missing or incorrectly specified. The SSL feature may not be enabled.

[ERROR ] CWWKS3005E: A configuration exception has occurred. No UserRegistry implementation service is available. Ensure that you have a user registry configured.

[ERROR ] CWWKS9113E: The SSL port is not active. The incoming http request cannot be redirected to a secure port. Check the server.xml file for configuration errors. The https port may be disabled. The keyStore element may be missing or incorrectly specified. The SSL feature may not be enabled.

[ERROR ] CWWKS9113E: The SSL port is not active. The incoming http request cannot be redirected to a secure port. Check the server.xml file for configuration errors. The https port may be disabled. The keyStore element may be missing or incorrectly specified. The SSL feature may not be enabled.

[ERROR ] Error Page Exception: com.ibm.ws.ui /adminCenter Error Page Exception

com.ibm.ws.webcontainer.webapp.WebAppErrorReport: com.ibm.ws.webcontainer.security.internal.WebSecurityCollaboratorException: Resource must be accessed with a secure connection try again using an HTTPS connection.

at com.ibm.ws.webcontainer.security.WebAppSecurityCollaboratorImpl.validateWebReply(WebAppSecurityCollaboratorImpl.java:578)

at [internal classes]

Caused by: com.ibm.ws.webcontainer.security.internal.WebSecurityCollaboratorException: Resource must be accessed with a secure connection try again using an HTTPS connection.

… 3 more

 

Solution

Add the following to the server.xml

 

Option a)

<!– Define an Administrator and non-Administrator –>

<basicRegistry id=”basic”>

<user name=”admin” password=”adminpwd” />

<user name=”nonadmin” password=”nonadminpwd” />

</basicRegistry>

 

<!– Assign ‘admin’ to Administrator –>

<administrator-role>

<user>admin</user>

</administrator-role>

 

<keyStore id=”defaultKeyStore” password=”Liberty” />

 

<httpEndpoint id=”defaultHttpEndpoint”

host=”*”

httpPort=”9080″

httpsPort=”9443″ />

 

 

Option b)

Create a quick start user, that is not part of a role-based registry

<quickStartSecurity userName=”admin” userPassword=”adminpwd” />

    <keyStore id=”defaultKeyStore” password=”Liberty” />

 

<!– To access this server from a remote client add a host attribute to the following element, e.g. host=”*” –>

<httpEndpoint id=”defaultHttpEndpoint”

httpPort=”9080″

httpsPort=”9443″ />

WAS and WASND and Liberty Profile and Liberty Core Runtime Glossary of Terms

$
0
0

Below is a glossary of terms which serves to clarify some of the product names and tags that people often interchange. So I have added this table to clear any misunderstandings about Liberty Core/Runtime, Liberty Profile Vs WAS Base and WAS ND.

Term Description
WebSphere Application Server (WAS) Base IBM WebSphere Application Server offers options for a faster, more flexible Java application server runtime environment. It offers enhanced reliability and resiliency for building and running applications, including cloud and mobile.
You can select the profile of WebSphere Application Server that best meets your operational and business needs. You are fully entitled to use the Full Profile and Liberty Profile in development and production with this edition.
WebSphere Application Server Network Deployment (WAS ND) IBM WebSphere Application Server Network Deployment provides an advanced, flexible runtime environment for large-scale application deployments. It offers near-continuous availability with advanced performance and management capabilities for mission-critical applications.
In addition, WebSphere Application Server Network Deployment offers flexibility in deployment. You can select the profile that best meets your operational and business needs—with this edition you are fully entitled to use the Full Profile and Liberty Profile in development and production.
Liberty Profile The Liberty profile is a highly composable and dynamic runtime environment. OSGi services are used to manage component lifecycles, and the injection of dependencies and configuration. The server process comprises a single JVM, the Liberty kernel, and any number of optional
features
Built for developers yet ready for production, it’s a combination of IBM technology and open source software, with fast startup times (<2 seconds), no server restarts to pick up changes, and a simple XML configuration. All in a package that’s <55mb to download
Liberty Core/Runtime IBM WebSphere Application Server Liberty Core is a lightweight and dynamic application server based on the developer-friendly Liberty profile.
Designed for web applications that do not require a full Java EE stack, this WebSphere solution is certified to the Java EE 6 Web Profile specification.

The capabilities available in the Liberty Core edition are a subset of the Liberty profile features provided in other editions of WebSphere Application Server. WebSphere Application Server Liberty Core enables less complex, rapid development and deployment of web and mobile applications using fewer resources.

Web Profile In an attempt to limit the footprint of web containers, both in physical and in conceptual terms, the web profile was created, a subset of the Java EE specifications
 

Note: More information can be found in APPENDIX B that covers the definition from Wikipedia of the JEE Web Profile

The installation package IBM WebSphere SDK Java Technology Edition Version 7.0 for Liberty requires components supplied by other packages

$
0
0

While installing IBM SDK 7.0 to be able to run WAS Liberty, you get the following error.

 

[root@localhost tools]# ./imcl install com.ibm.websphere.liberty.IBMJAVA.v70_7.0.4001.20130510_2103 -installationDirectory /var/apps/ibmsdk7.0 -sharedResourcesDirectory /var/IM/im-shared -repositories /var/apps/installs/IBM_SDK_7 -acceptLicense -showProgress -log /v ar/log/ibm/install/ibmsdk7.0.xml -preferences com.ibm.cic.common.core.preferences.keepFetchedFiles=false,com.ibm.cic.common.core.pref erences.preserveDownloadedArtifacts=false

25% 50% 75% 100%

——————|——————|——————|——————|

ERROR: The installation package ‘IBM WebSphere SDK Java Technology Edition Version 7.0 for Liberty’ requires components supplied by o ther packages.

The required components might be supplied by the following installation packages:

Package: IBM WebSphere Application Server Liberty

Package: IBM WebSphere Application Server Liberty Trial

Package: IBM WebSphere Application Server Liberty – Express

Package: IBM WebSphere Application Server Liberty – Express Trial

Package: IBM WebSphere Application Server Liberty Network Deployment

Package: IBM WebSphere Application Server Liberty Network Deployment Trial

Package: IBM WebSphere Application Server Liberty Core

Package: IBM WebSphere Application Server Liberty for z/OS

 

Reason, you are installing into a directory that does not contain a Liberty product, installation_directory, specify the appropriate WebSphere Application Server installation path on which to install IBM WebSphere SDK Java Technology Edition Version 7.0 or 7.1.

Correct Command:

./imcl install com.ibm.websphere.liberty.IBMJAVA.v70_7.0.4001.20130510_2103 -installationDirectory /var/apps/was8nd.5.5_LP -sharedResourcesDirectory /var/IM/im-shared -repositories /var/apps/installs/IBM_SDK_7 -acceptLicense -showProgress -log /var/log/ibm/install/ibmsdk7.0.xml -preferences com.ibm.cic.common.core.preferences.keepFetchedFiles=false,com.ibm.cic.common.core.preferences.preserveDownloadedArtifacts=false


CWWKF1203E: Unable to obtain the following features: [adminCenter-1.0]

$
0
0

When adding the Admin Center to a WAS ND Profile you get the error CWWKF1203E: Unable to obtain the following features: [adminCenter-1.0], this is because the version of Liberty Profile for WAS is < than 8.5.5.4

Install a newer fixpack ie use Google to search for WAS Liberty 8.5.5.4 fixpack and follow the links to download and install using IM (IBM Installation Manager). If you have not installed WAS Liberty with IM, then you will have to install a new extracted version of WAS Liberty 8.5.5.4 and migrate the appropriate folders from the  existing instance into the new instance.

ERROR – Expected installed package – Uninstalling Liberty Profile

$
0
0

Since in this guide we installed WAS ND Liberty Profile using IM, we will use IM to uninstall. Navigate to the IM eclipse/tools directory

cd /opt/IBM/InstallationManager/eclipse/tools

Prepare the imcl command using the following suntax

./imcl uninstall com.ibm.websphere.liberty.ND.v85 -installationDirectory installation_directory

Run the uninstall action

./imcl uninstall com.ibm.websphere.liberty.ND.v85_8.5.5000.20130514_1313 -installationDirectory /var/apps/was8nd.5.5_LP

Result:

ERROR: Expected installed package com.ibm.websphere.liberty.ND.v85 8.5.5000.20130514_1313, found 8.5.5004.20141121_1911.

 

OR

 

[root@localhost tools]# ./imcl uninstall com.ibm.websphere.liberty.ND.v85_8.5.5000.20130514_1313 -installationDirectory /var/apps/was8nd.5.5_LP

ERROR: Expected installed package com.ibm.websphere.liberty.ND.v85 8.5.5000.20130514_1313, found 8.5.5004.20141121_1911.

[root@localhost tools]# ./imcl uninstall com.ibm.websphere.liberty.ND.v85 -installationDirectory /var/apps/was8nd.5.5_LP

ERROR: The following errors were generated while uninstalling.

CRIMA1059E ERROR: Cannot uninstall IBM WebSphere Application Server Liberty Network Deployment because IBM WebSphere SDK Java Technology Edition Version 7.0 for Liberty requires components from it.

ERROR: In root installation context:

ERROR: Installation context “com.ibm.websphere.liberty.java.installcontext” was not resolved

Failed to uninstall com.ibm.websphere.liberty.ND.v85_8.5.5004.20141121_1911 from the /var/apps/was8nd.5.5_LP directory.

 

Reasons:

We have applied a fixpack and we have also applied an SDK

To uninstall using IM, we would need to do things in reverse order i.e. remove the fixpack, then the IBM SDK update, then we can remove your Liberty Installation.

Alternatively, don’t use IBM installation manager, however this is a process where you would need to maybe use installation manager to produce a golden copy, then distribute via archive. This is only important when using Liberty Profile, if you are using Liberty Runtime, then your approach would be for extraction/archive as you are dealing only with applications that need a Web Profile and so the installation footprint is circa 50-60 MB.

 


CWWKO0801E: Unable to initialize SSL connection

$
0
0

Error when joining a member to the collective for WebSphere Application Server Network Deployment Liberty Profile.

For example the join member command is run with the following parameters

./collective join member1 –host=localhost –port=9443 –user=admin –password=letmein –keystorePassword=secureme

Result:

[02/03/15 23:20:17:756 GMT] 0000002b com.ibm.ws.channel.ssl.internal.SSLHandshakeErrorTracker E CWWKO0801E: Unable to initialize SSL connection. Unauthorized access was denied or security settings have expired. Exception is javax.net.ssl.SSLHandshakeException: Client requested protocol SSLv3 not enabled or not supported

at sun.security.ssl.Handshaker.checkThrown(Handshaker.java:1336)

 

<info removed for brevity>

 

at com.ibm.ws.threading.internal.Worker.run(Worker.java:421)

at java.lang.Thread.run(Thread.java:745)

Caused by: javax.net.ssl.SSLHandshakeException: Client requested protocol SSLv3 not enabled or not supported

at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)

SSLUtils.handleHandshake(SSLUtils.java:718)

 

<info removed for brevity>

 

… 11 more

 

Explanation:

The SSL configuration contains attributes that are used to control the behavior of the server SSL transport layer.

The default SSL configuration settings are that When using the IBM JRE the SSL_TLS protocol will used. When using the Oracle JRE is used the SSLv3 protocol is used.

Since we are in this case using CentOS 7, we have the OpenJDK installed and is the default system JRE.

Because the JAVA_HOME variable is not set for the running collective, the OpenJDK is being used. Even though the server version command option reports something like:

[root@localhost bin]# ./server version controller1

WebSphere Application Server 8.5.5.0 (1.0.3.20130510-0831) on IBM J9 VM, version pxa6470sr4fp1ifx-20130423_02 (SR4 FP1+IV38579+IV38399+IV40208) (en_GB)

 

We have an issue because, the server knows about the IBM SDK, but when it is running, it is using the JAVA_HOME of the environment, which is OpenJDK.

Solution:

The best way to solve this is to JAVA_HOME is to create a server.env file in the ${server.config.dir} where server.xml is residing and add JAVA_HOME as in entry in that file.

OR

Use .bashrc and add a JAVA_HOME variable, but the problem with this is that multiple servers on the same machine will all reference the same actual location and this may not be want you wish. You want multiple servers on the same machine to use different SDKs.

Glossary of Terms for IBM WebSphere Application Server

$
0
0

Below is a glossary of terms which serves to clarify some of the product names and tags that people often interchange. So I have added this table to clear any misunderstandings about Liberty Core/Runtime, Liberty Profile Vs WAS Base and WAS ND.

Term Description
WebSphere Application Server (WAS) Base IBM WebSphere Application Server offers options for a faster, more flexible Java application server runtime environment. It offers enhanced reliability and resiliency for building and running applications, including cloud and mobile.

You can select the profile of WebSphere Application Server that best meets your operational and business needs. You are fully entitled to use the Full Profile and Liberty Profile in development and production with this edition.

WebSphere Application Server Network Deployment (WAS ND) IBM WebSphere Application Server Network Deployment provides an advanced, flexible runtime environment for large-scale application deployments. It offers near-continuous availability with advanced performance and management capabilities for mission-critical applications.

In addition, WebSphere Application Server Network Deployment offers flexibility in deployment. You can select the profile that best meets your operational and business needs—with this edition you are fully entitled to use the Full Profile and Liberty Profile in development and production.

Liberty Profile The Liberty profile is a highly composable and dynamic runtime environment. OSGi services are used to manage component lifecycles, and the injection of dependencies and configuration. The server process comprises a single JVM, the Liberty kernel, and any number of optional
features

Built for developers yet ready for production, it’s a combination of IBM technology and open source software, with fast startup times (<2 seconds), no server restarts to pick up changes, and a simple XML configuration. All in a package that’s <55mb to download

Liberty Core/Runtime IBM WebSphere Application Server Liberty Core is a lightweight and dynamic application server based on the developer-friendly Liberty profile.

Designed for web applications that do not require a full Java EE stack, this WebSphere solution is certified to the Java EE 6 Web Profile specification.

The capabilities available in the Liberty Core edition are a subset of the Liberty profile features provided in other editions of WebSphere Application Server. WebSphere Application Server Liberty Core enables less complex, rapid development and deployment of web and mobile applications using fewer resources.

Web Profile In an attempt to limit the footprint of web containers, both in physical and in conceptual terms, the web profile was created, a subset of the Java EE specifications

 

Note: More information can be found below that covers the definition from Wikipedia of the JEE Web Profile

 

JEE Web Profile

The JEE Web Profile as defined by Wikpedia at the following URL:

http://en.wikipedia.org/wiki/Java_Platform,_Enterprise_Edition#Web_profile

Changing the JAVA JRE for Liberty Profile

$
0
0

This guide explains How to install the IBM SDK or JRE using the public downloads.

It is possible to acquire the IBM SDK from the following URL, though you will need to register before downloading.

http://www.ibm.com/developerworks/java/jdk/linux/download.html

 

  • I have chosen to downloaded the 64 Bit version for the IBM 8 SDK/JRE

Note: It all depends on your requirements i.e. the application requirements to decide what SDK is required. In this example, I have used the IBM 8 SDK/JRE to demonstrate that Liberty can run in IBM 8 JRE

 

  • I was then prompted to register with IBM before I can continue.

 

 

 

  • Once I located the actual download page, I selected all the SDK options for example JDK and JRE and samples just in case I need them at another stage.

For Liberty we would only actually require the JRE to replace the standard default OpenJDK on CentOS for example.

In this example we will only install the IBM 8 JRE the file is:

ibm-java-x86_64-jre-8.0-2.0.bin

 

To do this we follow these steps:

Copy the JRE download to an appropriate folder for example:

/var/apps/installs/IBMSDK8

Modify to be able to run the bin file:

chmod 755 ibm-java-x86_64-jre-8.0-2.0.bin
  • Select the default options

Result:

Preparing to install…
Extracting the JRE from the installer archive…

Unpacking the JRE…

Extracting the installation resources from the installer archive…

Configuring the installer for this system’s environment…

Launching installer…

Graphical installers are not supported by the VM. The console mode will be used instead…

===============================================================================

Choose Locale…

—————-

1- Bahasa Indonesia

2- Català

3- Deutsch

->4- English

5- Español

6- Français

7- Italiano

8- Português

CHOOSE LOCALE BY NUMBER:

===============================================================================

IBM® 64-bit Runtime Environment for Linux®, v8.0 (created with InstallAnywhere)

——————————————————————————-

Preparing CONSOLE Mode Installation…

===============================================================================

International License Agreement for Non-Warranted Programs

Part 1 – General Terms

BY DOWNLOADING, INSTALLING, COPYING, ACCESSING, CLICKING ON AN

“ACCEPT” BUTTON, OR OTHERWISE USING THE PROGRAM, LICENSEE AGREES TO

THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCEPTING THESE TERMS ON

BEHALF OF LICENSEE, YOU REPRESENT AND WARRANT THAT YOU HAVE FULL

AUTHORITY TO BIND LICENSEE TO THESE TERMS. IF YOU DO NOT AGREE TO

THESE TERMS,

* DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, CLICK ON AN “ACCEPT” BUTTON,

OR USE THE PROGRAM; AND

* PROMPTLY RETURN THE UNUSED MEDIA AND DOCUMENTATION TO THE PARTY FROM

WHOM IT WAS OBTAINED FOR A REFUND OF THE AMOUNT PAID. IF THE PROGRAM

WAS DOWNLOADED, DESTROY ALL COPIES OF THE PROGRAM.

1. Definitions

Press Enter to continue viewing the license agreement, or enter “1” to

accept the agreement, “2” to decline it, “3” to print it, or “99” to go back

to the previous screen.: 1

===============================================================================

Introduction

————

InstallAnywhere will guide you through the installation of IBM® 64-bit Runtime

Environment for Linux®, v8.0.

It is strongly recommended that you quit all programs before continuing with

this installation.

Respond to each prompt to proceed to the next step in the installation. If you

want to change something on a previous step, type ‘back’.

You may cancel this installation at any time by typing ‘quit’.

PRESS <ENTER> TO CONTINUE:

===============================================================================

Choose Install Folder

———————

Where would you like to install?

Default Install Folder: /opt/ibm/java-x86_64-80

ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT

:

===============================================================================

Pre-Installation Summary

————————

Please Review the Following Before Continuing:

 

Product Name:

IBM® 64-bit Runtime Environment for Linux®, v8.0

Install Folder:

/opt/ibm/java-x86_64-80

Disk Space Information (for Installation Target):

Required: 181,926,137 Bytes

Available: 14,344,933,376 Bytes

 

PRESS <ENTER> TO CONTINUE:

===============================================================================

Installing…

————-

[==================|==================|==================|==================]

[——————|——————|——————|——————]

===============================================================================

Installation Complete

———————

Congratulations. IBM® 64-bit Runtime Environment for Linux®, v8.0 has been

successfully installed to:

/opt/ibm/java-x86_64-80

PRESS <ENTER> TO EXIT THE INSTALLER:

 

We now have installed IBM 8 JRE into:

/opt/ibm/java-x86_64-80

 

To change the JRE current version or use a different vendor i.e. in our case we wish to use IBM’s JRE as opposed to the default CentOS JRE, we can choose one of several options:

  • Use JAVA_HOME
  • Use a server.env file

Using JAVA_HOME in .bash_profile

JAVA_HOME will ensure that the current logged in user will use the specified JRE when several applications/products on the same machine refer to JAVA_HOME, this may not be what you want. But if this machine is only for Liberty then this is an easy choice.

 

Steps:

  • First we will verify the current JRE that is set for your environment, so we can test later that it has been changed.
java -version

Result:

java version “1.7.0_91″
OpenJDK Runtime Environment (rhel-2.6.2.1.el7_1-x86_64 u91-b00)

OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)

 

We will now need to set our environment buy editing .bash_profile

We want to set JAVA_HOME to where we have our JDK installed for example:

export JAVA_HOME=/opt/ibm/java-x86_64-80/jre

If JAVA_HOME/bin is not in the PATH, add it to the path:

export PATH=$JAVA_HOME/bin:$PATH

 

  • Edit your local bash profile (~/.bash_profile) and add two lines:
#Liberty
JAVA_HOME=/opt/ibm/java-x86_64-80/jre

PATH=$JAVA_HOME/bin:$PATH

 

export PATH

export JAVA_HOME

Example .bash_profile

We can either logout and re-login for the changes to take effect or we can source (execute) .bash_profile from our current session:

  • Now check what JRE is running for example:
which java

Result:

/opt/ibm/java-x86_64-80/jre/bin/java
  • We can now start an existing Liberty Server for example we have a liberty instance installed in /var/apps/wasnd855_lp/ and we have created a server called server1
/var/apps/wasnd855_lp/bin/server start server1

We can see that JRE used by looking at console.log for example:

cat /var/apps/wasnd855_lp/usr/servers/server1/logs/console.log

 

Result:

Launching server1 (WebSphere Application Server 8.5.5.0/wlp-1.0.3.20130510-0831) on IBM J9 VM, version pxa6480sr2-20151023_01 (SR2) (en_GB)
[AUDIT ] CWWKE0001I: The server server1 has been launched.

[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.

[AUDIT ] CWWKF0011I: The server server1 is ready to run a smarter planet.

 

We can now see that Liberty is now using the IBM JRE as opposed to the default CentoOS OpenJDK, but the issue is that now IBM JRE will be used for all application/software that refer to Java_HOME, and we may not want this. We may wish to have only Liberty use the IBM JRE. To do this we must refer to a server.env file.

 

Specifying JAVA_HOME using server.env

Before we do this, we will remove the edits made to .bash_profile to ensure that JAVA_HOME is not set as an environment variable.

[root@dmgr ~]# env | grep JAVA_HOME
[root@dmgr ~]# env | grep PATH

PATH=/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/opt/IBM/InstallationManager/eclipse/tools/

QT_PLUGIN_PATH=/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins

We can see above that the JAVA_HOME variable is not set, and the PATH specifies /user/bin for example:

which java

Result:

/usr/bin/java

 

java -version

Result:

java version “1.7.0_91″
OpenJDK Runtime Environment (rhel-2.6.2.1.el7_1-x86_64 u91-b00)

OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)

 

We can use server.env files at the install and server levels to specify environment variables such as JAVA_HOME, WLP_USER_DIR, and WLP_OUTPUT_DIR. These files support only KEY=value pairs. Shell and variable expansion are not supported.

The server management script will search for server.env files in two locations, ${wlp.install.dir}/etc/server.env and ${server.config.dir}/server.env. If both files are present, the contents of the two server.env files will be merged, with values in the the server-level file taking precedence over values in the runtime-level file.

Steps:

We will use a variable fro JAVA_HOME in a file called server.env, in this example it will be placed in the <installroot/>etc/server.env for example: /var/apps/wasnd855_lp/etc

  • Stop the server.
  • Create a file called /var/apps/wasnd855_lp/etc/server.env
mkdir -p /var/apps/wasnd855_lp/etc/

 

touch /var/apps/wasnd855_lp/etc/server.env

 

  • Edit the file with your favourite editor (I just logged in using WinSCP an used the default text editor) and set the JAVA_HOME variable to point to the JRE you want to use for example:

 

  • Close the file and save your changes.
  • Start the server
/var/apps/wasnd855_lp/bin/server start server1
  • Check the console.log
cat /var/apps/wasnd855_lp/usr/servers/server1/logs/console.log

Result:

Launching server1 (WebSphere Application Server 8.5.5.0/wlp-1.0.3.20130510-0831) on IBM J9 VM, version pxa6480sr2-20151023_01 (SR2) (en_GB)
[AUDIT ] CWWKE0001I: The server server1 has been launched.

[AUDIT ] CWWKZ0058I: Monitoring dropins for applications.

[AUDIT ] CWWKF0011I: The server server1 is ready to run a smarter planet.

 

Note that the version of the JRE listed in the console window now references the IBM 8 JRE Java version, as opposed to the current shell’s Java version.

 

 

 

facebooktwittergoogle_plusredditpinterestlinkedinmail

Liberty Profile Jython automation – TypeError – javax.management.remote.JMXServiceURL() – 3rd arg can’t be coerced to int

$
0
0

When running a Jython script to control the state of an Application Deployed to a Standalone Liberty Profile server, we get the following error:

TypeError: javax.management.remote.JMXServiceURL(): 3rd arg can't be coerced to int
root@node01 standalone]# ./controlApp.sh status HelloWorld-0.0.1-SNAPSHOT
Environment Settings
PATH=/opt/ibm/java-x86_64-80/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/var/apps/jython_2.7.0/bin
WLP_INSTALL_DIR=/var/apps/waslp_DV01/wlp
JYTHON_SCRIPTS=/var/apps/scripts/liberty
CLASSPATH=/var/apps/waslp_DV01/wlp/clients/restConnector.jar
JYTHONPATH=/var/apps/waslp_DV01/wlp/clients/jython:/var/apps/scripts/liberty/lib
script parameters
ACTION=status
APP_NAME=HelloWorld-0.0.1-SNAPSHOT
Server settings..
SERVER_NAME=server1
TRUST_STORE=/var/apps/waslp_DV01/wlp/usr/servers/server1/resources/security/key.jks
TRUST_STORE_PASSWORD=Liberty
HOST=192.168.0.40
PORT=9443
USER_NAME=wasadmin
USER_PASSWORD=wasadmin
Executing CMD: jython controlApp.py status HelloWorld-0.0.1-SNAPSHOT /var/apps/waslp_DV01/wlp/usr/servers/server1/resources/security/key.jks Liberty 192.168.0.40 9443 wasadmin wasadmin
MAIN:BEGIN
varName=controlApp.py
varValue=status
action=%s controlApp.py
appName=%s status
trustStore=%s HelloWorld-0.0.1-SNAPSHOT
trustStorePassword=%s /var/apps/waslp_DV01/wlp/usr/servers/server1/resources/security/key.jks
hostname=%s Liberty
port=%s 192.168.0.40
username=%s 9443
password=%s wasadmin
Connecting to the server...
Traceback (most recent call last):
  File "controlApp.py", line 57, in <module>
    _mBeanConnection  = getConnection(
  File "controlApp.py", line 21, in getConnection
    connector.connect(hostname, port, username, password)
  File "/var/apps/waslp_DV01/wlp/clients/jython/restConnector.py", line 57, in connect
    self.connectBasic(host, port, args[0], args[1])
  File "/var/apps/waslp_DV01/wlp/clients/jython/restConnector.py", line 76, in connectBasic
    self.connectAdvanced(host, port, map)
  File "/var/apps/waslp_DV01/wlp/clients/jython/restConnector.py", line 65, in connectAdvanced
    url = JMXServiceURL("REST", host, port, "/IBMJMXConnectorREST")
TypeError: javax.management.remote.JMXServiceURL(): 3rd arg can't be coerced to int

The reason for this is the line of code in the Jython script that create a connection to the Liberty Server’s JMX interface (WebSphere:service=com.ibm.websphere.application.ApplicationMBean,name=*) is a string not an int i.e. the port number was passed as string not int

def getConnection(trustStore, trustStorePassword, hostname, port, username, password) :
    JMXRESTConnector.trustStore = trustStore
    JMXRESTConnector.trustStorePassword = trustStorePassword
    
    connector = JMXRESTConnector()
    connector.connect(hostname, port, username, password)
    mconnection = connector.getMBeanServerConnection()
    return mconnection
#endDef

The code was changed from

_mBeanConnection  = getConnection( 
                trustStore, 
                trustStorePassword,
                hostname,
                port,
                username,
                password)

to

_mBeanConnection  = getConnection( 
                trustStore, 
                trustStorePassword,
                hostname,
                int(port),
                username,
                password)

 

facebooktwittergoogle_plusredditpinterestlinkedinmail

Liberty Profile Essentials Course Released July 2016

$
0
0

WebSphere Liberty is a fast, dynamic, easy-to-use Java EE application server, the latest Application Server technology from IBM and  today we release the new Liberty Essentials course.

During this course the student will learn how to automate installations and upgrades in a controlled manner using both IBM Installation Manager and the cloud -ready archive approach. Jython scripting is introduced and how to enable JDBC for data-ware applications.

The course covers the following topics:

  • Install, upgrade and uninstall WebSphere Liberty Profile using an Archive-Style approach
  • Install, upgrade and uninstall WebSphere Liberty Profile using IBM Installation Manager
  • Install, upgrade and uninstall WebSphere Liberty Profile using automation scripts
  • Build and Deploy a sample Web Application
  • Manage features and add ons
  • Configure an off-line feature repository to add features even when not connected to internet
  • Install and configure the Admin Center to provide a GUI-based admin console
  • Enable basic security to secure the Admin Console
  • Use JConsole to invoke exposed Management Beans (Mbeans) via JMX
  • Install, configure an implement Jython for Jython automation
  • Using Jython to manage deployed application-state
  • Locating demo /trial software from IBM
  • Enable a JDBC Provider and data source for a data-aware application
  • Install and configure MYSQL to support your data-aware Java Web-Application

Fully detailed comprehensive course notes are provided as part of the course.

Because Liberty is lightweight in nature it is Ideal for developers during rapid application development cycles but at the same time being ready for full production in cloud or non-cloud environments alike by Administrators.

WebSphere Liberty Profile Essentials
WebSphere Liberty Profile Essentials
The WebSphere Application Server 8.5.5.x Liberty Profile Essentials Course provides the student with a full set of guides and a set of commercial-grade automation scripts with detailed worked-examples.
Price: $149.99
Price: $49.99
facebooktwittergoogle_plusredditpinterestlinkedinmail
Viewing all 13 articles
Browse latest View live