While running the opatchauto   command in oracle grid you may face the jdk version error as below.

root # /crsapp/app/oracle/product/grid12c/OPatch/opatchauto apply /softdump/12C_GRIDSOFT/PATCH/22191349 -analyze -ocmrf /softdump/12C_GRIDSOFT/PATCH/grid.rsp
OPatch Automation Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 12.1.0.1.10
OUI Version : 12.1.0.2.0
Running from : /crsapp/app/oracle/product/grid12c

opatchauto log file: /crsapp/app/oracle/product/grid12c/cfgtoollogs/opatchauto/22191349/opatch_gi_2016-04-06_09-27-57_analyze.log

NOTE: opatchauto is running in ANALYZE mode. There will be no change to your system.

OCM RSP file has been ignored in analyze mode.

Parameter Validation: Successful

Failed: JDK version is incompatible.Please use a jdk version the same as, or later than 16
The result of cluvfy command does not contain OVERALL_STATUS String.
System Configuration Collection failed: oracle.osysmodel.driver.sdk.productdriver.ProductDriverException: Unable to determine if “/crsapp/app/oracle/product/grid12c” is a shared oracle home.
Failed: JDK version is incompatible.Please use a jdk version the same as, or later than 16
The result of cluvfy command does not contain OVERALL_STATUS String.
Exception in thread “main” java.lang.RuntimeException: java.io.IOException: Stream closed
at oracle.opatchauto.gi.GILogger.writeWithoutTimeStamp(GILogger.java:432)
at oracle.opatchauto.gi.GILogger.printStackTrace(GILogger.java:447)
at oracle.opatchauto.gi.OPatchauto.main(OPatchauto.java:97)
Caused by: java.io.IOException: Stream closed
at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:98)
at java.io.BufferedWriter.write(BufferedWriter.java:203)
at java.io.Writer.write(Writer.java:140)
at oracle.opatchauto.gi.GILogger.writeWithoutTimeStamp(GILogger.java:426)
… 2 more

opatchauto failed with error code 1.

 

SOLUTION:

In the above we can see we are using complete PATH for opatchauto  like /crsapp/app/oracle/product/grid12c/OPatch/opatchauto apply which is causing the error.

 

Instead of giving the complete PATH, go to that Opatch location and run the opatchauto utility as below.

 

root# cd /crsapp/app/oracle/product/grid12c/OPatch/

root# ./opatchauto apply /softdump/12C_GRIDSOFT/PATCH/22191349 -analyze -ocmrf /softdump/12C_GRIDSOFT/PATCH/grid.rsp

OUTPUT:

./opatchauto apply /softdump/12C_GRIDSOFT/PATCH/22191349 -ocmrf /softdump/12C_GRIDSOFT/PATCH/grid.rsp
OPatch Automation Tool
Copyright (c)2014, Oracle Corporation. All rights reserved.

OPatchauto Version : 12.1.0.1.10
OUI Version : 12.1.0.2.0
Running from : /crsapp/app/oracle/product/grid12c

opatchauto log file: /crsapp/app/oracle/product/grid12c/cfgtoollogs/opatchauto/22191349/opatch_gi_2016-04-07_09-17-04_deploy.log

Parameter Validation: Successful

Configuration Validation: Successful

Patch Location: /softdump/12C_GRIDSOFT/PATCH/22191349
Grid Infrastructure Patch(es): 21436941 21948341 21948344 21948354
DB Patch(es): 21948344 21948354

Patch Validation: Successful
Grid Infrastructure home:
/crsapp/app/oracle/product/grid12c
DB home(s):
/oracle/app/oracle/product/12.1.0.2/dbhome_1
Performing prepatch operations on CRS Home... Successful

Applying patch(es) to "/oracle/app/oracle/product/12.1.0.2/dbhome_1" ...
Patch "/softdump/12C_GRIDSOFT/PATCH/22191349/21948344" successfully applied to "/oracle/app/oracle/product/12.1.0.2/dbhome_1".
Patch "/softdump/12C_GRIDSOFT/PATCH/22191349/21948354" successfully applied to "/oracle/app/oracle/product/12.1.0.2/dbhome_1".

Applying patch(es) to "/crsapp/app/oracle/product/grid12c" ...
Patch "/softdump/12C_GRIDSOFT/PATCH/22191349/21436941" successfully applied to "/crsapp/app/oracle/product/grid12c".
Patch "/softdump/12C_GRIDSOFT/PATCH/22191349/21948341" successfully applied to "/crsapp/app/oracle/product/grid12c".
Patch "/softdump/12C_GRIDSOFT/PATCH/22191349/21948344" successfully applied to "/crsapp/app/oracle/product/grid12c".
Patch "/softdump/12C_GRIDSOFT/PATCH/22191349/21948354" successfully applied to "/crsapp/app/oracle/product/grid12c".

Performing postpatch operations on CRS Home... Successful

SQL changes, if any, are applied successfully on the following database(s): ULAPROD

Apply Summary:
Following patch(es) are successfully installed:
GI Home: /crsapp/app/oracle/product/grid12c: 21436941,21948341,21948344,21948354
DB Home: /oracle/app/oracle/product/12.1.0.2/dbhome_1: 21948344,21948354

opatchauto succeeded.