Wednesday, 21 November 2018

Goops, I broke WebSphere Liberty ....

Having started a Liberty instance, I was seeing errors : -

cat ~/wlp/usr/servers/foobar/logs/console.log

Launching foobar (WebSphere Application Server 18.0.0.3/wlp-1.0.22.cl180320180905-2337) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)
[AUDIT   ] CWWKE0001I: The server foobar has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/18.0.0.3/lafiles/en.html
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService.
[ERROR   ] CWWKE0702E: Could not resolve module: com.ibm.ws.ui [426]
  Unresolved requirement: Import-Package: org.apache.commons.io; packageType="was_internal"; version="1.4.0"

[AUDIT   ] CWWKF0012I: The server installed the following features: [beanValidation-2.0, servlet-4.0, ssl-1.0, jndi-1.0, jca-1.7, cdi-2.0, transportSecurity-1.0, jdbc-4.2, jms-2.0, ejbPersistentTimer-3.2, appSecurity-3.0, appSecurity-2.0, j2eeManagement-1.1, wasJmsServer-1.0, javaMail-1.6, jaxrs-2.1, restConnector-2.0, webProfile-8.0, adminCenter-1.0, jpa-2.2, jcaInboundSecurity-1.0, jsp-2.3, jsonb-1.0, ejbLite-3.2, managedBeans-1.0, jsf-2.3, ejbHome-3.2, jaxws-2.2, localConnector-1.0, jsonp-1.1, jaxrsClient-2.1, el-3.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, jaxb-2.2, mdb-3.2, jacc-1.5, javaee-8.0, batch-1.0, ejb-3.2, jpaContainer-2.2, json-1.0, jaspic-1.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[AUDIT   ] CWWKF0011I: The server foobar is ready to run a smarter planet.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/explore-1.0/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/api/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/IBMJMXConnectorREST/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/serverConfig-1.0/


for no apparent reason.

BUT I KNOW WHAT'S CHANGED :-)

I'd installed WLP 18.0.0.3 over 17.0.0.3, which is almost certainly the fault i.e. I merely unzipped one version over the other ….

I tried cleaning the server: -

~/wlp/bin/server start foobar --clean

but to no avail.

So it's nuking time …..

( THIS IS MY TEST ENVIRONMENT - DON'T TRY THIS ON A PRODUCTION SYSTEM !! )

Backup existing server.xml

cp ~/wlp/usr/servers/foobar/server.xml /tmp

Nuke existing installation

rm -Rf ~/wlp

Install WLP 18.0.0.3

unzip ~/Downloads/wlp-javaee8-18.0.0.3.zip 

Create a new server

~/wlp/bin/server create foobar

...
Server foobar created.


Create a SSL keystore

~/wlp/bin/securityUtility createSSLCertificate --server=foobar --password=passw0rd --validity=365

...
Creating keystore /Users/davidhay/wlp/usr/servers/foobar/resources/security/key.jks

Created SSL certificate for server foobar. The certificate is created with CN=10.128.1.1,OU=foobar,O=ibm,C=us as the SubjectDN.

Add the following lines to the server.xml to enable SSL:

    <featureManager>
        <feature>ssl-1.0</feature>
    </featureManager>
    <keyStore id="defaultKeyStore" password="{xor}Lz4sLChvLTs=" />



Restore previously backed-up  server.xml

cp /tmp/server.xml ~/wlp/usr/servers/foobar/server.xml 

For the record, this is what I have: -

<server description="new server">

    <featureManager>
        <feature>javaee-8.0</feature>
        <feature>localConnector-1.0</feature>
        <feature>adminCenter-1.0</feature>
        <feature>transportSecurity-1.0</feature>
    </featureManager>

    <keyStore id="defaultKeyStore" password="{xor}Lz4sLChvLTs="/>
    
    <httpEndpoint host="*" httpsPort="9443" id="defaultHttpEndpoint"/>
                  
    <applicationManager autoExpand="true"/>

    <applicationMonitor updateTrigger="mbean"/>

    <basicRegistry id="basic" realm="BasicRealm">
        <user name="wasadmin" password="{xor}Lz4sLChvLTs="/>
    </basicRegistry>

    <administrator-role>
        <user>wasadmin</user>
    </administrator-role>

    <remoteFileAccess>
        <writeDir>${server.config.dir}</writeDir>
    </remoteFileAccess>
</server>


Start server

~/wlp/bin/server start foobar

...
Starting server foobar.
Server foobar started with process ID 64926.


Check logs

cat ~/wlp/usr/servers/foobar/logs/console.log

...
Launching foobar (WebSphere Application Server 18.0.0.3/wlp-1.0.22.cl180320180905-2337) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)
[AUDIT   ] CWWKE0001I: The server foobar has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/18.0.0.3/lafiles/en.html
[ERROR   ] CWWKF0042E: A feature definition cannot  be found for the  admincenter-1.0 feature.  Try running the command, bin/installUtility install admincenter-1.0,  to install the feature. Alternatively, you can run the command, bin/installUtility install foobar,  to install all features that are referenced by this configuration.
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKS4104A: LTPA keys created in 0.444 seconds. LTPA key file: /Users/davidhay/wlp/usr/servers/foobar/resources/security/ltpa.keys
[AUDIT   ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService.
[AUDIT   ] CWWKF0012I: The server installed the following features: [beanValidation-2.0, servlet-4.0, ssl-1.0, jndi-1.0, jca-1.7, cdi-2.0, transportSecurity-1.0, jdbc-4.2, jms-2.0, ejbPersistentTimer-3.2, appSecurity-3.0, appSecurity-2.0, j2eeManagement-1.1, wasJmsServer-1.0, javaMail-1.6, jaxrs-2.1, webProfile-8.0, jpa-2.2, jcaInboundSecurity-1.0, jsp-2.3, jsonb-1.0, ejbLite-3.2, managedBeans-1.0, jsf-2.3, ejbHome-3.2, jaxws-2.2, localConnector-1.0, jsonp-1.1, jaxrsClient-2.1, el-3.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, jaxb-2.2, mdb-3.2, jacc-1.5, javaee-8.0, batch-1.0, ejb-3.2, jpaContainer-2.2, jaspic-1.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[AUDIT   ] CWWKF0011I: The server foobar is ready to run a smarter planet.


noting that I'm missing adminCenter-1.0

Stop server

~/wlp/bin/server stop foobar

Install missing feature(s)

~/wlp/bin/installUtility install foobar

Checking for missing features required by the server ...
The server requires the following additional features: admincenter-1.0.  Installing features from the repository ...
Establishing a connection to the configured repositories ...
This process might take several minutes to complete.

Successfully connected to all configured repositories.

Preparing assets for installation. This process might take several minutes to complete.

Additional Liberty features must be installed for this server.

To install the additional features, review and accept the feature license agreement:
Select [1] I Agree, or [2] I do not Agree:  1

Step 1 of 20: Downloading servlet-3.0 ...
Step 2 of 20: Installing servlet-3.0 ...
Step 3 of 20: Downloading restConnector-1.0 ...
Step 4 of 20: Installing restConnector-1.0 ...
Step 5 of 20: Downloading jsp-2.2 ...
Step 6 of 20: Installing jsp-2.2 ...
Step 7 of 20: Downloading adminCenter-1.0 ...
Step 8 of 20: Installing adminCenter-1.0 ...
Step 9 of 20: Downloading cdi-1.2 ...
Step 10 of 20: Installing cdi-1.2 ...
Step 11 of 20: Downloading jaxrs-1.1 ...
Step 12 of 20: Installing jaxrs-1.1 ...
Step 13 of 20: Downloading servlet-3.1 ...
Step 14 of 20: Installing servlet-3.1 ...
Step 15 of 20: Downloading jaxrsClient-2.0 ...
Step 16 of 20: Installing jaxrsClient-2.0 ...
Step 17 of 20: Downloading jaxrs-2.0 ...
Step 18 of 20: Installing jaxrs-2.0 ...
Step 19 of 20: Validating installed fixes ...
Step 20 of 20: Cleaning up temporary files ...


All assets were successfully installed.

Start product validation...
Product validation completed successfully.

Start server

~/wlp/bin/server start foobar

Check logs

cat ~/wlp/usr/servers/foobar/logs/console.log

...
Launching foobar (WebSphere Application Server 18.0.0.3/wlp-1.0.22.cl180320180905-2337) on Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_181-b13 (en_GB)
[AUDIT   ] CWWKE0001I: The server foobar has been launched.
[AUDIT   ] CWWKE0100I: This product is licensed for development, and limited production use. The full license terms can be viewed here: https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/license/base_ilan/ilan/18.0.0.3/lafiles/en.html
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications.
[AUDIT   ] CWWKI0001I: The CORBA name server is now available at corbaloc:iiop:localhost:2809/NameService.
[AUDIT   ] CWWKF0012I: The server installed the following features: [beanValidation-2.0, servlet-4.0, ssl-1.0, jndi-1.0, jca-1.7, cdi-2.0, transportSecurity-1.0, jdbc-4.2, jms-2.0, ejbPersistentTimer-3.2, appSecurity-3.0, appSecurity-2.0, j2eeManagement-1.1, wasJmsServer-1.0, javaMail-1.6, jaxrs-2.1, restConnector-2.0, webProfile-8.0, adminCenter-1.0, jpa-2.2, jcaInboundSecurity-1.0, jsp-2.3, jsonb-1.0, ejbLite-3.2, managedBeans-1.0, jsf-2.3, ejbHome-3.2, jaxws-2.2, localConnector-1.0, jsonp-1.1, jaxrsClient-2.1, el-3.0, concurrent-1.0, appClientSupport-1.0, ejbRemote-3.2, jaxb-2.2, mdb-3.2, jacc-1.5, javaee-8.0, batch-1.0, ejb-3.2, jpaContainer-2.2, json-1.0, jaspic-1.1, distributedMap-1.0, websocket-1.1, wasJmsSecurity-1.0, wasJmsClient-2.0].
[AUDIT   ] CWWKF0011I: The server foobar is ready to run a smarter planet.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/api/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/explore-1.0/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/ibm/adminCenter/serverConfig-1.0/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/IBMJMXConnectorREST/
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://192.168.153.1:9080/adminCenter/

...

Good to go …..

No comments:

The Modern Mainframe Developer Hands On Drop-In Centre - Thursday, May 2, 2019

Come along at any time, grab a machine and away you go. Refreshments and snacks will be provided. This first meetup is funded by IBM. The ...