Wednesday 15 June 2016

Automatic Patching of SOA/BPM QuickStarts

Earlier I wrote how to automatically install the SOA/BPM QuickStarts. Actually, I'm quite busy with doing automatic/scripted installs for SOA/BPM Suite and OSB, as you might have read.

At my current customer we encountered that in the last months there are many one-off-patches released on support.oracle.com. We selected a pretty large bunch of patches and apply them one by one is a tedious job. But the thing is with these automatic installs that you want to have a uniform installation for each developer so each developer should have the same patches installed, in the same location. And you probably want to be able to quickly do a re-install to a uniform setup.

So I figured out how to do a silent install of the patches and to do this in a loop.

Out of the selected patches I found 5 catechories:
  • 001: JDeveloper patches, where only a few we found possibly applicable for the SOA/BPM QuickStarts
  • 002: ServiceBus related patches
  • 003: SOA Suite merged patches
  • 004: SOA Suite related other patches
  • 005: BPM Suite merged patches
  • 006: BPM Suite related patches
So I divided the patches in those 5 folders ('001', '002', ... , '005'). And I numbered them in 3 digit folders, since my scripting needed to figure out the patch number from the path name. Each patch is a zip with a sub-folder with only the patch number (without the 'p'). So the path-lengths needed to be equal (so not 'jdev' and 'soa' or 'osb').

I have one main script called 'installQSPatches.bat' that loops over the files in each sub-folder:
@echo off
rem check SOA12.2 QS
setlocal
set FMW_HOME=C:\oracle\JDeveloper\12210_BPMQS
set ORACLE_HOME=%FMW_HOME%
set SOA_PATCH_SOURCE=SOA
set SOA_PATCH_HOME=%FMW_HOME%\Opatch\patches
set CUR_DIR=%~dp0
echo Current Dir: %CUR_DIR%
if exist "%FMW_HOME%" goto :SOAQS_HOME_EXISTS
echo %FMW_HOME% not installed yet! Install first!
goto :DONE
:SOAQS_HOME_EXISTS
echo %FMW_HOME% exists, install Patches
echo ____________________________________________________
call %FMW_HOME%\wlserver\server\bin\setWLSEnv.cmd
echo ____________________________________________________
:JDEV_PATCHES
echo -
echo JDeveloper Patches
echo ____________________________________________________
for %%f in (001\*.zip) do (
  echo %%f
  call applyPatch %%f 
)
:SB_PATCHES
echo -
echo ServiceBus Patches
echo ____________________________________________________
for %%f in (002\*.zip) do (
  echo %%f
  call applyPatch %%f 
)
:SOA_MERGE_PATCHES
echo -
echo SOA Suite Merged Patches
echo ____________________________________________________
for %%f in (003\*.zip) do (
  echo %%f
  call applyPatch %%f 
)
:SOA_PATCHES
echo -
echo SOA Suite Patches
echo ____________________________________________________
for %%f in (004\*.zip) do (
  echo %%f
  call applyPatch %%f 
)
:BPM_MERGE_PATCHES
echo -
echo BPM Suite Merged Patches
echo ____________________________________________________
for %%f in (005\*.zip) do (
  echo %%f
  call applyPatch %%f 
)
:BPM_PATCHES
echo -
echo BPM Suite Patches
echo ____________________________________________________
for %%f in (006\*.zip) do (
  echo %%f
  call applyPatch %%f 
)
:DONE
echo Done installing patches
endlocal
You need to shutdown JDeveloper and IntegratedWeblogic before starting this script.
And it needs to be started in an elevated (as Administrator) command window.

For each patch it calls the applyPatch.bat script:
set PATCH=%1
set PATCH_NR=%PATCH:~5,8%
echo ____________________________________________________
echo Check Patch %PATCH% for patch nr %PATCH_NR%
if exist "%FMW_HOME%\Opatch\patches\%PATCH_NR%" goto :PATCH_EXISTS
echo "%FMW_HOME%\Opatch\patches\%PATCH_NR%" does not exist.
set SOA_PATCH_HOME=%FMW_HOME%\Opatch\patches
rem set SOA_PATCH_HOME=c:\temp\patches
echo .. Unzip %SOA_PATCH_SOURCE%\%PATCH% to %SOA_PATCH_HOME%
call ant -f ant-zip.xml unzip -Dzip-file=%PATCH% -Dunzip-destination=%SOA_PATCH_HOME%
cd %ORACLE_HOME%\Opatch\patches\%PATCH_NR%
echo  .. Apply %ORACLE_HOME%\Opatch\patches\%PATCH_NR%
call %ORACLE_HOME%\Opatch\opatch apply -silent
cd %CUR_DIR%
goto :DONE
:PATCH_EXISTS
echo Patch %PATCH_NR% already exits!
:DONE
echo Done for patch %PATCH_NR%
echo ____________________________________________________

This one figures out what the patchnumber (%PATCH_NR%) is based on the patch-file-name, and if that patch already exists in the %FMW_HOME%/Opatch/patches folder. If not it will unzip the patch file to that folder, resulting in a sub-folder named with the patch number. Then it will apply the patch using Opatch in silent mode.
For the unzip, it uses a simple ANT build file, since the Windows Command screen does not support a commandline-unzip (as far as I could find). The ANT script is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<project name="zip" default="zip" basedir=".">

 <target name="zip">
  <zip destfile="${zip-file}.zip" basedir="${folder-to-zip}" excludes="dont*.*" />
 </target>

 <target name="unzip">
  <unzip src="${zip-file}" dest="${unzip-destination}" />
 </target>

</project>

When I finished this I thought I should convert it to a complete ANT script. But maybe later.

The selected patches for 12.2.1:
The selected JDeveloper patches (sub-folder 001) were:
  • 22283405    JDEV 12.2.1 - NULLPOINTEREXCEPTION ENCOUNTERED (Patch)
  • 23266774    VALIDATION ERRORS WHEN CLICKING ON MANDATORY FIELDS IN JDEV12.2.1 (Patch)
  • 22463346    NOT STRESS SOA: MULTIPLE ERROR MESSAGES OF DEFINITIONMANAGER.LOCKINGLOGGER (Patch)
  • 21890657    CREATE REST THROWS ERROR 500 FOR REFERENCED ENTITY (Patch)
These are not all the possible JDeveloper patches and even may not apply to developing SOA/BPM or SB processes or services.

The selected Service Bus patches (sub-folder 002) were:
  • 23223332 Need to provide a holistic solution in main line for Bug 22887808
  • 21824551 NPE while trying to read OWSM keystore
  • 21168191 UnsupportedOperationException from ServiceAccountRuntimeCache
  • 23184618 Http Transport throws NullPointerException
  • 21827583 Deploying existing .sbar with Maven
  • 22738111 OSB Java Call out method's not visible from JDeveloper
  • 20119834 need to trim headers size if size exceeds 998 characters.
  • 22358699 OSB12C fn-bea:inlinedXML does not work properly
  • 22374613 In 12.2.1 the OSB Projet pom files still says 12.1.3
  • 20196110 JDev OSB Extension has missed export Split-Join and Proxy Flow as png
  • 22187224 OSB 12.2.1 - MessageID changes between request and response messages
  • 22392646 Maven could not be used in Jdev in 12.2.1.0.0
  • 22602059 12C: OSB pipeline based on XML - $body structure incomplete - missing node
  • 22276364 12C: OSB pipeline based on XML - $body structure unavailable
  • 21659900 OSB removes WSA headers on outbound request 
 The selected SOA Suite merged patches (sub-folder 003) were:
  • 23543517 MERGE REQUEST ON TOP OF 12.2.1.0.0 FOR BUGS 23527297 22875806 22995356 23062804
  • 23138916 MERGE REQUEST ON TOP OF 12.2.1.0.0 FOR BUGS 21549249 21572567
  • 23106839 MERGE REQUEST ON TOP OF 12.2.1.0.0 FOR BUGS 21826430 22912570
  • 23134140 Diagnostic Tracking Bug for Bug 23108573 v2
The selected SOA Suite regular patches (sub-folder 004) were:
  • 23056585 XQuery transformation is not showing all the types of XSD in the design view
  • 21904101 Error when running ValidateComposite to project with bpel calling HWF
  • 23205706 MALFORMEDURLEXCEPTION EXCEPTION ON JDEV 12.2.1.0.0 - BAM 12C IDE CONNECTION
  • 23193066 BPEL polls from UMS Adapter results in too large CONVERSATION_ID error
  • 21698320 SELECTING ELEMENT IN LARGE DOCUMENT TAKES FREEZES 2+MINUTES
  • 23108573 TrackingContextProperty causes ClassCastException in SOA 12c Spring Composite
  • 21925552 SOA Maven Plugin requires deploying sar to server when running mvn install
  • 23186275 JDeveloper 12.2.1 JMS Adapter not displaying Elements from the imported xsd file
  • 22337707 Naming conflict with EDN event subscribers from single Mediator component
  • 23052343 16.2.3 : WS JOB REQUEST ENDS UP IN ERROR STATE WHEN INVOKED VIA OTD URL
  • 22026475 JDEV : Adapter : Nullpointerexception while creating the BPEL Process
  • 22815366 Unable to use WSDL containing an unsupported Notification Operation portType
  • 22978098 Indicators configured on Response payload coming from a DB ADapter do not work
  • 21835972 SFTP FileListing not work as expected. Need similiar bug fix as in bug 21176154
  • 22648699 SOA Suite12.2.1-JCA files not getting updated with Configuration Plan values
  • 22300448 JDeveloper doesn't add a libraries file group to existing SOA deployment profile
  • 16548396 Can not emulate fault from the SOA Test UI
Of these the patches 21925552 conflicts with 21904101 and 23193066 conflicts with 23108573. So you should choose which one you want to apply.

For BPM (sub-folder 005) the following merged patches were selected:
  • 22571194 NPE in o.bpm.project.sca.loader.impl.ElementContainer:82
  • 23283093 NPE in o.bpm.project.sca.loader.impl.ElementContainer:198
For BPM (sub-folder 006) the following patches were selected:
  • 22191778 In the Business Architecture Modeling links section, buttons are missing
  • 21325503 12c compilation err-crm: oracle.bpm.services : extncontentpublicmodeleventaction
  • 22736087 BPM Workspace not refreshing the task list after Initiator task page is closed
  • 22018713 MeasurementPublisher has been optimized
  • Software 22217468 Refresh is not working properly in Impact Analysis Report - 500 error
  • 22018703 MIAuditLog has been optimized
  • 22690780 workspace Title & logo unchanged on loginpage after patch 22272135
  • 19536412 Case Service handles namespaces incorrectly in SOAP XML messages
  • 22348182 EDG RC3a :Task comments cannot be added
  • 22087208 When approving a task it immediately opens the next task in your tasklist
  • 22753983 12c e-manager authorization issues - List view
  • 22111729 BPM instance is not released after completing an HT ith the voting patern
  • 22581888 Configure global option to enable task details to appear as pop-up window in 12c
  • 23077279 Composer crash when creating Org Unit or Application system for human task
  • 23125361 REST hrefs for attachments containing spaces in their names do not work.
  • 23205514 Flexfields not properly displayed in parallel task with SDO
  • 23301503 weblogic user or Administrator group shouldn't be necessary to login to composer
  • 23491602 Studio generated project_properties.wsdl missing the correlation mapping
  • 21792613 NOT STRESS BPM REST:get WebFormService - no valid constructor error 
 From these the 22581888 conflicts with 22087208. And  23205514 conflicts with 22348182.

Download the applicable patches for your situation and put them in the appropriate folder. If you use the SOA QuickStart in stead of  BPM QuickStart, you should skip the BPM Related patches of course.
UPDATE september 26th, 2016: Since this is a Windows script: you need to run this on the same drive as the QuickStart installer. It does a change dir to the patch and then an 'Opatch apply'. But if it's not run on the same drive, the change dir succeeds, but it's on another drive so still not current.

No comments :