Saturday, March 9, 2019

Issue: emcli login failed

[oemapp@xxxxx emcli]$ emcli login -username="sysman" -password="oracle123" 
Error: Connection to the current OMS could not be established. Check the log files for further details. 
Log file location is : /mwhome/app/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/.emcli.log 
[oemapp@xxxxx emcli]$ pwd 
/mwhome/app/gc_inst/em/EMGC_OMS1/sysman/emcli 
[oemapp@xxxxx emcli]$ cd ../../.. 
[oemapp@xxxxx em]$ ls 
EMGC_OMS1 

Cause:
emcli.log: 
======== 

Mar 06, 2019 2:05:14 PM oracle.sysman.emCLI.omsbrowser.OMSBrowser submitRequest 
SEVERE: IOException in 5(5) try of submitRequest to /em/console/cli : 
Mar 06, 2019 2:05:14 PM oracle.sysman.emSDK.emCLI.verb.RemoteVerb execute 
SEVERE: 
oracle.sysman.emCLI.omsbrowser.HttpConnectionException: 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.submitRequest2(OMSBrowser.java:1797) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.submitRequest(OMSBrowser.java:1607) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.submitCommand(OMSBrowser.java:1507) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.getPageInternal(OMSBrowser.java:948) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.getPageCommon(OMSBrowser.java:854) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.getPageSplitStream(OMSBrowser.java:828) 
at oracle.sysman.emSDK.emCLI.verb.RemoteVerb.execute(RemoteVerb.java:273) 
at oracle.sysman.install.emcli.GetPlatformClientVerb.execute(GetPlatformClientVerb.java:53) 
at oracle.sysman.emSDK.emCLI.CLIController.execute(CLIController.java:367) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:498) 
at oracle.sysman.emCLI.StandAloneLaunchHandler.invoke(StandAloneLaunchHandler.java:413) 
at oracle.sysman.emCLI.StandAloneLaunchHandler.launch(StandAloneLaunchHandler.java:286) 
at oracle.sysman.emSDK.emCLI.CLIController.launch(CLIController.java:255) 
at oracle.sysman.emSDK.emCLI.CLIController.main(CLIController.java:207) 
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure 
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) 
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) 
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:2020) 
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1127) 
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1367) 
at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:750) 
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123) 
at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:167) 
at HTTPClient.HTTPConnection.sendRequest(HTTPConnection.java:3524) 
at HTTPClient.HTTPConnection.handleRequest(HTTPConnection.java:3436) 
at HTTPClient.HTTPConnection$10.run(HTTPConnection.java:3187) 
at HTTPClient.HTTPConnection$10.run(HTTPConnection.java:3178) 
at HTTPClient.HttpClientConfiguration.doAction(HttpClientConfiguration.java:1083) 
at HTTPClient.HTTPConnection.doAction(HTTPConnection.java:5616) 
at HTTPClient.HTTPConnection.setupRequest(HTTPConnection.java:3178) 
at HTTPClient.HTTPConnection.Post(HTTPConnection.java:1131) 
at HTTPClient.HTTPConnection.Post(HTTPConnection.java:1085) 
at oracle.sysman.emCLI.omsbrowser.OMSBrowser.submitRequest2(OMSBrowser.java:1760) 
... 16 more 

It is observed that some of the 1.8 JDK updates are not allowing the communication between EMCLI and OMS. 

Follow the solution from the below MOS note solution for this issue. 

EM13c : Emcli Fails While Login And Sync - Error: Connection to the current OMS could not be established ( Doc ID 2392010.1 ) 

Action Plan:

[root@xxxxx opt]# tar xvf /mwhome/app/patches/jdk-7u211-linux-x64.tar.gz
[root@xxxxx opt]# cd jdk1.8.0_201/
[root@xxxxx jdk1.8.0_201]# alternatives --install /usr/bin/java java /opt/jdk1.7.0_211/bin/java 2
[root@xxxxx jdk1.8.0_201]# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.201-2.6.16.1.0.1.el7_6.x86_64/jre/bin/java)
*  2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java)
 + 3           /opt/jdk1.8.0_201/bin/java

Enter to keep the current selection[+], or type selection number:
[root@xxxxx jdk1.8.0_201]# alternatives --install /usr/bin/jar jar /opt/jdk1.7.0_211/bin/jar 2
[root@xxxxx jdk1.8.0_201]# alternatives --install /usr/bin/javac javac /opt/jdk1.7.0_211/bin/javac 2
[root@xxxxx jdk1.8.0_201]# alternatives --set jar /opt/jdk1.7.0_211/bin/jar
[root@xxxxx jdk1.8.0_201]# alternatives --set javac /opt/jdk1.7.0_211/bin/javac
[root@xxxxx jdk1.8.0_201]# java -version
[root@xxxxx jdk1.8.0_201]# su - oemapp
[root@xxxxx jdk1.8.0_201]#export JAVA_HOME=/mwhome/app/oemapp/oracle_common/jdk/jre
[root@xxxxx jdk1.8.0_201]#export JRE_HOME=/mwhome/app/oemapp/oracle_common/jdk/jre
[root@xxxxx jdk1.8.0_201]#export PATH=$PATH:/mwhome/app/oemapp/oracle_common/jdk/bin:/mwhome/app/oemapp/oracle_common/jdk/jre/bin

[oemapp@xxxxx jre]$ /mwhome/app/oemapp/oracle_common/jdk/jre/bin/java -version
java version "1.7.0_111"
Java(TM) SE Runtime Environment (build 1.7.0_111-b13)

Java HotSpot(TM) 64-Bit Server VM (build 24.111-b13, mixed mode)

[oemapp@xxxxx jre]$ emcli status
Oracle Enterprise Manager 13c Release 2 EM CLI.
Copyright (c) 1996, 2016 Oracle Corporation and/or its affiliates. All rights reserved.

Instance Home          : /mwhome/app/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli
Verb Jars Home         : /mwhome/app/oemapp/bin/./bindings/13.2.0.0.0/.emcli
Status                 : Configured
EM CLI Home            : /mwhome/app/oemapp/bin
EM CLI Version         : 13.2.0.0.0
Java Home              : /mwhome/app/oemapp/oracle_common/jdk/jre
Java Version           : 1.7.0_111
Log file               : /mwhome/app/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/.emcli.log
Log level              : SEVERE
EM URL                 : https://xxxxx .xxxxx .net:7803/em
EM user                : sysman
Auto login             : false
Trust all certificates : true

[oemapp@xxxxx jre]$

Setup the EMCLI 
##########

[oemapp@xxxxx jre]$ emcli setup -url=https://xxxxx .xxxxx .net:7803/em -username="sysman" -password="oracle123" -trustall
Oracle Enterprise Manager 13c Release 2.
Copyright (c) 1996, 2016 Oracle Corporation and/or its affiliates. All rights reserved.

Emcli setup successful


[oemapp@xxxxx jre]$ emcli get_supported_platforms
-----------------------------------------------
Version = 13.2.0.0.0
 Platform = Linux x86-64
-----------------------------------------------
Version = 13.2.0.0.0
 Platform = Microsoft Windows x64 (64-bit)
-----------------------------------------------
Version = 13.2.0.0.0
 Platform = Oracle Solaris on SPARC (64-bit)
-----------------------------------------------
Platforms list displayed successfully.

[oemapp@xxxxx jre]$