Wednesday, 8 November 2017

How to find Oracle WebLogic Server Version?

Today one of my customer asked me the way to find out weblogic server version which they have installed so thought to share details with you as well.

There are different ways to determine Oracle Weblogic Service Version. Use one of the following method to find weblogic server version.

1. We can determine weblogic server version using registry.xml file:
Location in WLS 12.2.1.3:
$ORACLE_HOME/inventory/registry.xml

<distribution status="installed" name="WebLogic Server" version="12.2.1.3.0">

e.g.
/u02/oracle12213/oracle_home/middleware/inventory/registry.xml

<?xml version = '1.0' encoding = 'UTF-8' standalone = 'yes'?>
<registry home="/u02/oracle12213/oracle_home/middleware" platform="226" sessions="5" xmlns:ns2="http://xmlns.oracle.com/cie/gdr/dei" xmlns:ns3="http://xmlns.oracle.com/
cie/gdr/nfo" xmlns="http://xmlns.oracle.com/cie/gdr/rgy">
   <distributions>
      <distribution status="installed" name="WebLogic Server" version="12.2.1.3.0">
         <sessions>
            <session id="1" date="2017-10-21T17:53:51.433+05:30" action="install"/>
         </sessions>
         <features>
            <feature status="installed" name="cieCfg_wls_shared_external" version="12.2.1.3.0">
               <sessions>

2. We can user weblogic.jar file (weblogic.version class) to find weblogic server version:
Go to $WLS_HOME/server/lib
e.g. For WLS 12.2.1.3
/u02/oracle12213/oracle_home/middleware/wlserver/server/lib

Use below command to find weblogic and it's component version,
java -cp weblogic.jar weblogic.version -verbose

e.g.
[oracle@demomachine lib]$ java -cp weblogic.jar weblogic.version -verbose

WebLogic Server 12.2.1.3.0 Thu Aug 17 13:39:49 PDT 2017 1882952 ImplVersion: 12.2.1.3.0
Oracle Security Developer Tools Security Engine ImplVersion: 3.1.0
Oracle Security Developer Tools Crypto ImplVersion: 3.1.0
Oracle Universal Connection Pool ImplVersion: 12.2.0.1.0
WebLogic Config External  Thu Aug 10 00:41:12 UTC 2017 ImplVersion: 8.6.0.0
WebLogic Application Descriptors ImplVersion: 12.2.1.3
WebLogic Application Descriptors Bindings ImplVersion: 12.2.1.3
WebLogic Application Container ImplVersion: 12.2.1.3
WebLogic Utility Classloader implementations ImplVersion: 12.2.1.3
WebLogic Descriptors for J2EE ImplVersion: 12.2.1.3
WebLogic Beangen ImplVersion: 12.2.1.3
WebLogic BeanInfo Caching and Discovery ImplVersion: 12.2.1.3
WebLogic Descriptor ImplVersion: 12.2.1.3
WebLogic Beangen ImplVersion: 12.2.1.3
WebLogic Coherence Descriptor ImplVersion: 12.2.1.3
WebLogic Coherence Api ImplVersion: 12.2.1.3
WebLogic Coherence App Descriptor ImplVersion: 12.2.1.3
WebLogic Coherence Integration ImplVersion: 12.2.1.3
WebLogic Workarea ImplVersion: 12.2.1.3
WebLogic Nodemanager Plugin ImplVersion: 12.2.1.3
WebLogic RMI ImplVersion: 12.2.1.3
WebLogic Timers ImplVersion: 12.2.1.3
WebLogic Channels API ImplVersion: 12.2.1.3
WebLogic Channels ImplVersion: 12.2.1.3
WebLogic Channels API ImplVersion: 12.2.1.3
WebLogic Socket Muxer API ImplVersion: 12.2.1.3
WebLogic java compiler utils package ImplVersion: 12.2.1.3
WebLogic Utils for working with Expressions ImplVersion: 12.2.1.3
WebLogic Utils ImplVersion: 12.2.1.3
WebLogic Utils ImplVersion: 12.2.1.3
WebLogic Utils for Dynamically Generated Class Wrappers ImplVersion: 12.2.1.3
WebLogic Work Manager ImplVersion: 12.2.1.3
WebLogic Datasource ImplVersion: 12.2.1.3
WebLogic RAC Module UCP ImplVersion: 12.2.1.3
WebLogic Resource Pool ImplVersion: 12.2.1.3
WebLogic Diagnostics Base ImplVersion: 12.2.1.3
WebLogic Diagnostics Core Interfaces ImplVersion: 12.2.1.3
WebLogic Diagnostics JRockit Flight Recorder Interfaces ImplVersion: 12.2.1.3
WebLogic i18n Build Support ImplVersion: 12.2.1.3
WebLogic i18n Runtime Support ImplVersion: 12.2.1.3
WebLogic I18N tools ImplVersion: 12.2.1.3
WebLogic Diagnostics Instrumentor Config Tool ImplVersion: 12.2.1.3
WebLogic Diagnostics Instrumentor Tool ImplVersion: 12.2.1.3
WebLogic Diagnostics Logging ImplVersion: 12.2.1.3
WebLogic Diagnostics Query Module ImplVersion: 12.2.1.3
WebLogic EJBGen ImplVersion: 12.2.1.3
WebLogic Messaging Kernel ImplVersion: 12.2.1.3
WebLogic JMS Pool ImplVersion: 12.2.1.3
WebLogic Security Provider Generation Tool ImplVersion: 12.2.1.3
WebLogic Domain Binding ImplVersion: 12.2.1.3
WebLogic Management Core Interfaces ImplVersion: 12.2.1.3
WebLogic Management EventBus Interfaces ImplVersion: 12.2.1.3
WebLogic Management JMX Interfaces ImplVersion: 12.2.1.3
Oracle Cooperative Memory Management Lower Tier ImplVersion: 12.2.1.3
WebLogic EclipseLink Integration ImplVersion: 12.2.1.3
WebLogic SCA Client ImplVersion: 12.2.1.3
WebLogic security network connection filter classes ImplVersion: 12.2.1.3
WebLogic security ssl classes ImplVersion: 12.2.1.3
WebLogic Spring Instrument Tool ImplVersion: 12.2.1.3
WebLogic Store ImplVersion: 12.2.1.3
WebLogic Store Admin Tool ImplVersion: 12.2.1.3
WebLogic STORE GXA ImplVersion: 12.2.1.3
WebLogic JDBC Store ImplVersion: 12.2.1.3
WebLogic JTA implementation ImplVersion: 12.2.1.3
WebLogic WebApp Container Public API ImplVersion: 12.2.1.3
WebLogic Servlet ImplVersion: 12.2.1.3
WebLogic Http Pub/Sub Module ImplVersion: 12.2.1.3
WebLogic SAAJ ImplVersion: 12.2.1.3
WebLogic STAX ImplVersion: 12.2.1.3
WebLogic Jersey Common Integration ImplVersion: 12.2.1.3
WebLogic Jersey Client Integration ImplVersion: 12.2.1.3
WebLogic JAX-RS 2.0 Portable Server / Jersey 2.x integration module ImplVersion: 12.2.1.3
WebLogic XML XPath Implementation ImplVersion: 12.2.1.3
OPatch Patches:
No patches installed

SERVICE NAME                    VERSION INFORMATION
============                    ===================
Web Services Execution Engine   1.0
Managed Beans Container         1.0
Post Admin Singleton Services   1.0
Pre Admin Singleton Services S  1.0
Singleton Services Batch Manag  1.0
Kernel                          Commonj WorkManager v1.1
CorbaService                    CORBA 2.3, IIOP 1.2, RMI-IIOP SFV2, OTS 1.2, CSIv2 Level 0 + Stateful
TimerService                    Commonj TimerManager v1.1
JDBCService                     JSR-221, JDBC 4.0
Enterpise Java Beans Container  EJB 3.2
CustomResourceServerService     1.0.0.0
Transaction Service             JTA 1.1
Transaction Stop Service        JTA 1.1
Servlet Container               Servlet 3.1, JSP 2.3
XMLService                      XML 1.1

[oracle@demomachine lib]$

3. We can find weblogic server version from check the AdminServer.log file:
Go to $DOMAIN_HOME/servers/AdminServer/logs
Check AdminServer.log file for weblogic server version

e.g.
####<Oct 24, 2017 3:39:16,238 PM IST> <Info> <WebLogicServer> <demomachine> <> <Thread-10> <> <> <> <1508839756238> <[severity-value: 64] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000214> <WebLogic Server "AdminServer" version: WebLogic Server 12.2.1.3.0 Thu Aug 17 13:39:49 PDT 2017 1882952 Copyright (c) 1995,2017, Oracle and/or its affiliates. All rights reserved.>

4. We can use WLST to check weblogic server version:
Go to $ORACLE_HOME/oracle_common/bin
Invoke wlst.sh
Use command print version

e.g.
wls:/offline> print version
WebLogic Server 12.2.1.3.0
wls:/offline>

5. We can use admin console to check weblogic server version:
Login to WebLogic Admin Console and navigate to Servers => AdminServer => Monitoring tab
This page will have weblogic version details.
OR
When you open Admin console, version will be displayed at the bottom of the welcome page.

e.g.
WebLogic Server Version: 12.2.1.3.0
Copyright (c) 1996,2017, Oracle and/or its affiliates. All rights reserved.

Monday, 6 November 2017

OHS instance failed to start because of (98)Address already in use: AH00072: make_sock: could not bind to address XXX.XXX.XXX.XX:7777

========================================================================
Environment Details:
OHS: 12.2.1.3.0

========================================================================
Problem Summary:
When we are trying to start OHS instance it's failing with an error (98)Address already in use: AH00072: make_sock: could not bind to address XXX.XXX.XXX.XX:7777

Have verified port 7777 if it's already used using lsof and netstat but nothing was listening on that port. It was free.
@machine1 config]# /usr/sbin/lsof -i:7777
@machine1 config]# netstat | grep 7777
@machine1 config]# netstat

Error:
Starting server ohs1 ...
Nov 05, 2017 12:56:48 PM oracle.ohs.plugin.nodemanager.OhsProcessManagementPlugin$ProcessImpl start
INFO: Starting server ohs1
Nov 05, 2017 12:56:48 PM oracle.ohs.plugin.nodemanager.OhsRunCommand execute
INFO: Running /u02/oracle/middleware/oracle_home/wlserver/../ohs/bin/launch httpd -DOHS_MPM_EVENT -d /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/config/fmwconfig/components/OHS/instances/ohs1 -k start -f /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/config/fmwconfig/components/OHS/instances/ohs1/httpd.conf
Nov 05, 2017 12:56:49 PM oracle.ohs.plugin.nodemanager.OhsRunCommand runGeneric
INFO: (98)Address already in use: AH00072: make_sock: could not bind to address XXX.XXX.XXX.XX:7777
Nov 05, 2017 12:56:49 PM oracle.ohs.plugin.nodemanager.OhsRunCommand runGeneric
INFO: no listening sockets available, shutting down
Nov 05, 2017 12:56:49 PM oracle.ohs.plugin.nodemanager.OhsRunCommand runGeneric
INFO: AH00015: Unable to open logs
Nov 05, 2017 12:56:49 PM oracle.ohs.plugin.nodemanager.OhsRunCommand execute
SEVERE: /u02/oracle/middleware/oracle_home/wlserver/../ohs/bin/launch httpd -DOHS_MPM_EVENT -d /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/config/fmwconfig/components/OHS/instances/ohs1 -k start -f /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/config/fmwconfig/components/OHS/instances/ohs1/httpd.conf: exit status = 1
Nov 05, 2017 12:56:49 PM oracle.ohs.plugin.nodemanager.OhsProcessHandler buildProcess
INFO: Check the instance log file for more information: /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/servers/ohs1/logs/ohs1.log
Nov 05, 2017 12:56:49 PM oracle.ohs.plugin.nodemanager.OhsProcessManagementPlugin$ProcessImpl buildIoException
SEVERE: Failed to start the server ohs1
<Nov 5, 2017 12:56:49 PM IST> <WARNING> <Server start command for OHS server 'ohs1' failed due to: [Failed to start the server ohs1
Check log file /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/system_components/OHS/ohs_nm.log
Check log file /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/servers/ohs1/logs/ohs1.log]. Please check Node Manager log and/or server 'ohs1' log for detailed information.>

This Exception occurred at Sun Nov 05 12:52:39 IST 2017.
weblogic.nodemanager.NMException: Received error message from Node Manager Server: [Server start command for OHS server 'ohs1' failed due to: [Failed to start the server ohs1


========================================================================
Root Cause:
There were 2 things which were creating above problem,
1. System wasn't connected to network. Network was OFF.
2. /etc/hosts was having wrong ip configured.

========================================================================
Resolution:
1. Have connected system to network. Network ON.
2. Have edited /etc/hosts and configured the correct IP.
3. Restarted OHS and it came up fine.
Starting server ohs1 ...
Nov 05, 2017 1:11:07 PM oracle.ohs.plugin.nodemanager.OhsProcessManagementPlugin$ProcessImpl start
INFO: Starting server ohs1
Nov 05, 2017 1:11:07 PM oracle.ohs.plugin.nodemanager.OhsRunCommand execute
INFO: Running /u02/oracle/middleware/oracle_home/wlserver/../ohs/bin/launch httpd -DOHS_MPM_EVENT -d /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/config/fmwconfig/components/OHS/instances/ohs1 -k start -f /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/config/fmwconfig/components/OHS/instances/ohs1/httpd.conf
Nov 05, 2017 1:11:07 PM oracle.ohs.plugin.nodemanager.OhsRunCommand runGeneric
INFO: Errors will be logged into /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/servers/ohs1/logs/ohs1.log
Nov 05, 2017 1:11:09 PM oracle.ohs.plugin.nodemanager.OhsRunCommand execute
INFO: /u02/oracle/middleware/oracle_home/wlserver/../ohs/bin/launch httpd -DOHS_MPM_EVENT -d /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/config/fmwconfig/components/OHS/instances/ohs1 -k start -f /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/config/fmwconfig/components/OHS/instances/ohs1/httpd.conf: exit status = 0
Nov 05, 2017 1:11:09 PM oracle.ohs.plugin.nodemanager.OhsProcessHandler buildProcess
INFO: Check the instance log file for more information: /u02/oracle/middleware/oracle_home/user_projects/domains/ohs_domain/servers/ohs1/logs/ohs1.log
<Nov 5, 2017 1:11:12 PM IST> <INFO> <ohs_domain> <ohs1> <The server 'ohs1' is running now.>
Successfully started server ohs1 ...

Saturday, 28 October 2017

OEM 13c installer failed to start becuase of Failed prerequisite Checking monitor: must be configured to display at least 256 colors. Actual unknown. Failed

========================================================================
Environment Details:
OEM : 13c (13.2.0.0)
OS : Linux6

========================================================================
Problem Summary:
Am trying to invoke OEM installer for OEM installation but it's getting failed becuase of prerequisite failure.

Error:
-bash-4.1$ /u01/OEM13c_Soft/em13200_linux64.bin
0%.........................................................................100%
Launcher log file is /tmp/OraInstall2017-10-27_02-42-25AM/launcher2017-10-27_02-42-25AM.log.
Starting Oracle Universal Installer

Checking if CPU speed is above 300 MHz.   Actual 2295.051 MHz    Passed
Checking monitor: must be configured to display at least 256 colors.  Actual unknown.   Failed <<<<
Checking swap space: must be greater than 512 MB.   Actual 34287 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)

Some system prerequisite checks failed.
You must fulfill these requirements before continuing.

Continue? (yes [y] / no [n]) [n]
n
You have confirmed that the product cannot be installed on this platform.
Quitting the installation.
The log is located here: /tmp/OraInstall2017-10-27_02-42-25AM/launcher2017-10-27_02-42-25AM.log.

========================================================================
Root Cause:
Was using root/superuser user to trigger installer instead of oracle which holds ownership of OEM installer.

========================================================================
Resolution:
1. Close the session which you have logged in with root user.
2. Login to the host as oracle user.
Kindly note if you login to host using root and then switch to oracle might not work and you may end up in same error so you have to start a new session and directly login as oracle user.
4. Go to OEM13c installer directory and invoke installer.

Wednesday, 25 October 2017

How to upgrade java/jdk used by Weblogic server 12.2.1.3 to different version

==============================================================================
Environment Details:
Weblogic : 12.2.1.3
OS : Linux
==============================================================================
In this case we are going to install new java/jdk to different location and change JAVA_HOME variable in all scripts using it.
So let's get started.

Have installed jdk1.8.0._151 in the directory /u02/oracle12213/custom/java/ and provided permissions 775 to it.

[oracle@demomachine ~]$ cd /u02/downloads/
[oracle@demomachine downloads]$ ll
total 1186004
-rwxrwxr-x. 1 oracle oracle 839208313 Aug 21 12:39 fmw_12.2.1.3.0_wls.jar
-rwxrwxr-x. 1 oracle oracle 185516505 Jul 25 21:06 jdk-8u141-linux-x64.tar.gz
-rw-rw-r--. 1 oracle oracle 189736377 Oct 24 01:35 jdk-8u151-linux-x64.tar.gz
[oracle@demomachine downloads]$ chmod -R 775 *
[oracle@demomachine downloads]$ ll
total 1186004
-rwxrwxr-x. 1 oracle oracle 839208313 Aug 21 12:39 fmw_12.2.1.3.0_wls.jar
-rwxrwxr-x. 1 oracle oracle 185516505 Jul 25 21:06 jdk-8u141-linux-x64.tar.gz
-rwxrwxr-x. 1 oracle oracle 189736377 Oct 24 01:35 jdk-8u151-linux-x64.tar.gz
[oracle@demomachine downloads]$ tar -xzf jdk-8u151-linux-x64.tar.gz -C /u02/oracle12213/custom/java/
[oracle@demomachine downloads]$ cd /u02/oracle12213/custom/java/
[oracle@demomachine java]$ ll
total 0
drwxrwxr-x. 8 oracle oracle 255 Jul 12 17:11 jdk1.8.0_141
drwxr-xr-x. 8 oracle oracle 255 Sep  6 08:02 jdk1.8.0_151
[oracle@demomachine java]$ chmod -R 775 jdk1.8.0_151/
[oracle@demomachine java]$

Oracle home and domain home is under /u02 so going to find out the files which are having jdk1.8.0_141 configred in it using below linux command,
grep -iworI 'jdk1.8.0_141' . | uniq | egrep -v "/logs/|/adr/|\.log|\.out|/.patch_storage|/inventory" | tr ':' ' ' |awk '{print $1}'

[oracle@demomachine u02]$ grep -iworI 'jdk1.8.0_141' . | uniq | egrep -v "/logs/|/adr/|\.log|\.out|/.patch_storage|/inventory" | tr ':' ' ' |awk '{print $1}'
./oracle12213/oracle_home/middleware/oui/bin/launch.sh
./oracle12213/oracle_home/middleware/oui/bin/viewInventory.sh
./oracle12213/oracle_home/middleware/oui/bin/compareInventory.sh
./oracle12213/oracle_home/middleware/oui/bin/setProperty.sh
./oracle12213/oracle_home/middleware/oui/.globalEnv.properties
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/bin/setDomainEnv.sh
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/bin/setNMJavaHome.sh
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/domain-info.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/startscript.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/tokenValue.properties
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/nodemanager-properties.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/nodemanager/nodemanager.properties


There are few files which need not to be changed,
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/domain-info.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/startscript.xml
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/tokenValue.properties
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/init-info/nodemanager-properties.xml

Files which need to changed are,
./oracle12213/oracle_home/middleware/oui/bin/launch.sh
./oracle12213/oracle_home/middleware/oui/bin/viewInventory.sh
./oracle12213/oracle_home/middleware/oui/bin/compareInventory.sh
./oracle12213/oracle_home/middleware/oui/bin/setProperty.sh
./oracle12213/oracle_home/middleware/oui/.globalEnv.properties
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/bin/setDomainEnv.sh
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/bin/setNMJavaHome.sh
./oracle12213/oracle_home/middleware/user_projects/domains/wls_domain/nodemanager/nodemanager.properties

Shutdown all servers and nodemanager.
Take backup of domain and oracle home direcotries.

Edit all the below files and change JAVA_HOME location from /u02/oracle12213/custom/java/jdk1.8.0_141 to /u02/oracle12213/custom/java/jdk1.8.0_151
-----------------------------------------------------------
$oracle_home/oui/bin/launch.sh

# pre-install env: JAVA_HOME_LOCATION not stringsubbed
# post-install env: JAVA_HOME_LOCATION is stringsubbed
#JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_141"
JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_151"
------------------------------------------------------------
$oracle_home/oui/bin/viewInventory.sh

# OUI platform name used at install time
PLATFORM_NAME="Linux_AMD64"

#JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_141"
JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_151"
-----------------------------------------------------------------
$oracle_home/oui/bin/compareInventory.sh

# pre-install env: JAVA_HOME_LOCATION not stringsubbed
# post-install env: JAVA_HOME_LOCATION is stringsubbed
#JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_141"
JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_151"
----------------------------------------------------------------------
$oracle_home/oui/bin/setProperty.sh

#JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_141"
JAVA_HOME_LOCATION="/u02/oracle12213/custom/java/jdk1.8.0_151"
----------------------------------------------------------------------
$oracle_home/oui/.globalEnv.properties

#Sat Oct 21 17:55:26 IST 2017
#JAVA_HOME=/u02/oracle12213/custom/java/jdk1.8.0_141
#JAVA_HOME_1_8=/u02/oracle12213/custom/java/jdk1.8.0_141
JAVA_HOME=/u02/oracle12213/custom/java/jdk1.8.0_151
JAVA_HOME_1_8=/u02/oracle12213/custom/java/jdk1.8.0_151
---------------------------------------------------------------------
$domain_home/bin/setDomainEnv.sh

#SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
export SUN_JAVA_HOME

#DEFAULT_SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
DEFAULT_SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
export DEFAULT_SUN_JAVA_HOME

else
                JAVA_VENDOR="Oracle"
                export JAVA_VENDOR
                #JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
                JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
                export JAVA_HOME

----------------------------------------------------------------------
$domain_home/bin/setNMJavaHome.sh

#SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
export SUN_JAVA_HOME

#DEFAULT_SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
DEFAULT_SUN_JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
export DEFAULT_SUN_JAVA_HOME

 else
                JAVA_VENDOR="Oracle"
                export JAVA_VENDOR
                #JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_141"
                JAVA_HOME="/u02/oracle12213/custom/java/jdk1.8.0_151"
                VM_TYPE="HotSpot"

----------------------------------------------------------------------------
$domain_home/nodemanager/nodemanager.properties

#JavaHome=/u02/oracle12213/custom/java/jdk1.8.0_141
JavaHome=/u02/oracle12213/custom/java/jdk1.8.0_151

----------------------------------------------------------------------------
Restart nodemanager and servers.
Login to admin console. Click on Environment -> servers -> monitoring and verify the java version.

WebLogic Home:
/u02/oracle12213/oracle_home/middleware/wlserver
Middleware Home:
/u02/oracle12213/oracle_home/middleware
Java Vendor:
Oracle Corporation
Java Version:
1.8.0_151
OS Name:
Linux
OS Version:
3.10.0-693.el7.x86_64

Friday, 20 October 2017

WLST to decrypt Weblogic, jdbc and java keystore passwords offline

We can decrypt weblogic, jdbc and java keystore passwords offline using WLST.

Kindly follow below steps to decrypt them offline using WLST ( No Script/Online dependency ):
1.      Login to admin server host
2.      Go to $ORACLE_HOME/oracle_common/common/bin
3.      Invoke wlst.sh OR wlst.cmd
4.      wls:/offline> domain = "<$domain_home_path>"
5.      wls:/offline> service = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)
6.      wls:/offline> encryption = weblogic.security.internal.encryption.ClearOrEncryptedService(service)
7.      wls:/offline> print encryption.decrypt("<encrypted password>")
Please note, in encrypted string we have to remove backward slash symbol.

Examples:
For Linux:
[oracle@demomachine ~]$ cd /u02/oracle12213/osb/oracle_home/oracle_common/common/bin
[oracle@demomachine u02]$./wlst.sh

wls:/offline> domain = "/u02/Oracle12213/osb/domain/dev_domain "
wls:/offline> service = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)
wls:/offline> encryption = weblogic.security.internal.encryption.ClearOrEncryptedService(service)
wls:/offline> print encryption.decrypt("{AES}577uW8U1WXvE9Ep+9gw7V3ZfJiyjD5TDT3id5X9LtdE= ")
weblogic


For Windows:
C:\windows\system32>cd C:\Oracle12213\Middleware\Oracle_Home\oracle_common\common\bin
C:\Oracle12213\Middleware\Oracle_Home\oracle_common\common\bin>wlst.cmd

Initializing WebLogic Scripting Tool (WLST) ...

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> domain = "C:\\Oracle12213\\Middleware\\Oracle_Home\\user_projects\\domains\\dev_domain"
wls:/offline> service = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domain)
wls:/offline> encryption = weblogic.security.internal.encryption.ClearOrEncryptedService(service)
wls:/offline> print encryption.decrypt("{AES}Rx9/lKeFMhllwNMYXWtC+DryFL9zU3MypEPLNtJ+W4w=")
weblogic123

=========================================================================================
Issues Faced:
You may face below issue while decrypting passwords if you don’t remove backward slash symbol.

Error:
wls:/offline> print encryption.decrypt("{AES}Rx9/lKeFMhllwNMYXWtC+DryFL9zU3MypEPLNtJ+W4w\=")
Traceback (innermost last):
  File "<console>", line 1, in ?
        at weblogic.security.internal.encryption.JSafeEncryptionServiceImpl.decryptBytes(JSafeEncryptionServiceImpl.java:144)
        at weblogic.security.internal.encryption.JSafeEncryptionServiceImpl.decryptString(JSafeEncryptionServiceImpl.java:192)
        at weblogic.security.internal.encryption.ClearOrEncryptedService.decrypt(ClearOrEncryptedService.java:99)
        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)

weblogic.security.internal.encryption.EncryptionServiceException: weblogic.security.internal.encryption.EncryptionServiceException: com.rsa.jsafe.JSAFE_InputException: Invalid input.

Resolution:
If you are facing above error, kindly delete backward slash symbols from the encrypted string and retry.
e.g. From {AES}Rx9/lKeFMhllwNMYXWtC+DryFL9zU3MypEPLNtJ+W4w\=
To {AES}Rx9/lKeFMhllwNMYXWtC+DryFL9zU3MypEPLNtJ+W4w=

Managed server failed to start becuase of Failed to invoke startup class "JRF Startup Class", java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup

========================================================================
Environment Details:
Weblogic : 10.3.6
OSB : 11.1.1.7.0
OS : Windows 10

========================================================================
Problem Summary:
Am using weblogic admin console to start managed server but unable to start managed server because of Failed to invoke startup class "JRF Startup Class", java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup

Error:
<Oct 16, 2017 8:10:24 PM IST> <Notice> <Log Management> <BEA-170019> <The server log file C:\OraclePS6\Middleware\user_projects\domains\osb_domain\servers\osb_server1\logs\osb_server1.log is opened. All server side log events will be written to this file.>
<Oct 16, 2017 8:10:28 PM IST> <Notice> <Security> <BEA-090082> <Security initializing using security realm myrealm.>
<Oct 16, 2017 8:10:30 PM IST> <Critical> <WebLogicServer> <BEA-000286> <Failed to invoke startup class "JRF Startup Class", java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup
java.lang.ClassNotFoundException: oracle.jrf.wls.JRFStartup
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
Truncated. see log file for complete stacktrace
>

========================================================================
Root Cause:
StartScriptEnabled is set to false in nodemanager.properties.

========================================================================
Resolution:
1. Open C:\OraclePS6\Middleware\wlserver_10.3\common\nodemanager\nodemanager.properties on the managed server machine.
2. Set StartScriptEnabled=true.
3. Restart the node manager.
4. Stop the managed server.
5. Start the managed server from Admin console.

Tuesday, 28 March 2017

RCU fails while creating soainfra schema with ORA-01450: maximum key length (6398) exceeded

========================================================================
Applies to:
Weblogic : 12.2.1.2
OSB: 12.2.1.2

========================================================================
Problem Summary:
Creation of SOA INFRA schema using RCU is failing  becuase of ORA-01450: maximum key length (6398) exceeded

Error:
ORA-01450: maximum key length (6398) exceeded
File:/u01/poc/osb_home/fmw_12_2_1_2/soa/common/sql/soainfra/sql/oracle/createschema_soainfra_oracle_LARGE.sql
Statement:ALTER TABLE B2B_CONTROL_NUMBER
    ADD CONSTRAINT B2B_CONTROL_NUMBER_PK PRIMARY KEY (SENDER_NAME, RECEIVER_NAME, DOC_PROTOCOL_NAME, DIRECTION, NAME, IS_DEFAULT)

========================================================================
Root Cause:
We are facing above problem because of the NLS_LENGTH_SEMANTICS parameter which has been set to CHAR in database. It's not a supported setting for schema creation using RCU. Oracle OSB only supports schemas in a byte-mode(BYTE) database.

========================================================================
How to verify:
Connect to database and run below SQL to verify setting,
show parameters nls_length_semantics

========================================================================
Resolution:
nls_length_semantics initialization parameter on the database where the schemas going to reside must be set to BYTE.

To set the nls_length_semantics parameter to BYTE, login to the database as SYSDBA and issue the following command,
alter system set NLS_LENGTH_SEMANTICS=BYTE scope=both;

Once we change nls_length_semantics please restart the database for changes to take effect.

Now rerun RCU to create schemas.