How to Re-deploy EAR file for Identity Portal in Websphere

Document ID : KB000010571
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

In WebSphere, you have to re-deploy the full ear file in order to make changes to the application. The following procedure is used to update the EAR file for use in any particular environment. The update includes enablement of FIPS support as well as configuration for the WF engine.

Background:

 

Customer need to apply a fix for Identity Portal deployed on Websphere.

This Procedure explains the steps to apply a Fix (ie. wpClientServlet.jar created specially to resolve a defect)

Note : the file does not exists on the current EAR file. You will need to add the file to the iam_im.ear

 

Process consist on :

 

A) Export the iam_im.ear

B) Unpack EAR File

C)  Apply the fix

D) Re-package the EAR file

E) Update the EAR file in WebSphere

 

Environment:
IDM 12.64 , Windows Server 2012 WebSphere 8.5.5.5 IDP 1.6.2 (all them in installed Mode , not Virtual Appliance )
Instructions:

 

A) Export IAM_IM Application EAR

 

 1) In WAS console, Click on ApplicationsàApplication TypesàWebSphere enterprise Applications

screen01.jpg

 

2)  Click the checkbox next to iam_im application and click on Export

 

screen02.jpg

 

3)  Once done, click on iam_im.ear and save the file 

 

screen03.jpg

 

 

B) Unpack iam_im.ear File

 

1)     SCP the following directory from the WAS ND machine to your computer /opt/IBM/WebSphere/AppServer/WebSphere-tools

2)     Navigate to the WebSphere-tools directory

1)     Edit the unpack.xml file and replace the content with these lines:

<?xml version="1.0" encoding="UTF-8" ?>

<project name="Unpackage IDM EAR" default="unpackage" basedir=".">

 

    <property name="root.dir" value="${basedir}/.." />

    <property name="application.name" value="iam_im"/>

    <property name="build.output.dir" value="${outputdir}/WebSphere-ear/${application.name}.ear"/>

    <property name="temp.dir" value="${application.name}.ear_temp" />

 

 

    <!-- build an EAR file for WebSphere deployment -->

    <target name="unpackage">

        <mkdir dir="${temp.dir}"/>

        <mkdir dir="${build.output.dir}"/>

 

        <echo message="Earpath: ${earpath}"/>

        <unjar src="${earpath}" dest="${temp.dir}"/>

       

        <!-- rename compressed modules -->

        <move file="${temp.dir}/user_console.war" tofile="${temp.dir}/user_console.temp.war"/>

        <move file="${temp.dir}/management_console.war" tofile="${temp.dir}/management_console.temp.war"/>

        <move file="${temp.dir}/policyserver.rar" tofile="${temp.dir}/policyserver.temp.rar"/>

        <move file="${temp.dir}/workflow.rar" tofile="${temp.dir}/workflow.temp.rar"/>

        <move file="${temp.dir}/identityminder_ejb.jar" tofile="${temp.dir}/identityminder_ejb.temp.jar"/>        

       <move file="${temp.dir}/ca-nim-sm.war" tofile="${temp.dir}/ca-nim-sm.temp.war"/>

 

                <!-- unpack compressed modules -->

        <unjar src="${temp.dir}/user_console.temp.war" dest="${temp.dir}/user_console.war"/>

        <unjar src="${temp.dir}/management_console.temp.war" dest="${temp.dir}/management_console.war"/>

        <unjar src="${temp.dir}/policyserver.temp.rar" dest="${temp.dir}/policyserver.rar"/>

        <unjar src="${temp.dir}/workflow.temp.rar" dest="${temp.dir}/workflow.rar"/>

        <unjar src="${temp.dir}/identityminder_ejb.temp.jar" dest="${temp.dir}/identityminder_ejb.jar"/>

       <unjar src="${temp.dir}/ca-nim-sm.temp.war" dest="${temp.dir}/ca-nim-sm.war"/>

 

        <!-- remove compressed modules -->

        <delete file="${temp.dir}/user_console.temp.war"/>

        <delete file="${temp.dir}/management_console.temp.war"/>

        <delete file="${temp.dir}/policyserver.temp.rar"/>

        <delete file="${temp.dir}/workflow.temp.rar"/>

        <delete file="${temp.dir}/identityminder_ejb.temp.jar"/>

        <delete file="${temp.dir}/ca-nim-sm.temp.war"/>

 

        <copy todir="${build.output.dir}">

            <fileset dir="${temp.dir}"/>

        </copy>

        <delete dir="${temp.dir}"/>

 

    </target>

 

</project>

 

2)     Save and close the file

3)     Edit the package.xml file and replace the content with these lines:

 

<?xml version="1.0" encoding="UTF-8" ?>

<project name="Package IDM EAR" default="package" basedir=".">

 

    <property name="root.dir" value="${basedir}/.." />

    <property name="application.name" value="iam_im"/>

    <property name="build.output.dir" value="${root.dir}/WebSphere-ear/${application.name}.ear"/>

    <property name="temp.dir" value="${application.name}.ear_temp" />

 

 

    <!-- build an EAR file for WebSphere deployment -->

    <target name="package">

        <mkdir dir="${temp.dir}"/>

        <copy todir="${temp.dir}">

            <fileset dir="${build.output.dir}"/>

        </copy>

 

        <!-- war up user_console.war -->

        <war destfile="${temp.dir}/user_console.temp.war"

             webxml="${temp.dir}/user_console.war/WEB-INF/web.xml"

             manifest="${temp.dir}/user_console.war/META-INF/MANIFEST.MF"

             basedir="${temp.dir}/user_console.war"

             includes="**"

        />

 

        <!-- war up management_console.war -->

        <war destfile="${temp.dir}/management_console.temp.war"

             webxml="${temp.dir}/management_console.war/WEB-INF/web.xml"

             basedir="${temp.dir}/management_console.war"

             manifest="${temp.dir}/management_console.war/META-INF/MANIFEST.MF"

             includes="**"

        />

 

        <!-- jar up policyserver.rar -->

        <jar destfile="${temp.dir}/policyserver.temp.rar"

             basedir="${temp.dir}/policyserver.rar"

             manifest="${temp.dir}/policyserver.rar/META-INF/MANIFEST.MF"

             includes="**"

        />

 

        <!-- jar up workflow.rar -->

        <jar destfile="${temp.dir}/workflow.temp.rar"

             basedir="${temp.dir}/workflow.rar"

             manifest="${temp.dir}/workflow.rar/META-INF/MANIFEST.MF"

             includes="**"

        />

 

        <!-- jar up identityminder_ejb.jar -->

        <jar destfile="${temp.dir}/identityminder_ejb.temp.jar"

             basedir="${temp.dir}/identityminder_ejb.jar"

             manifest="${temp.dir}/identityminder_ejb.jar/META-INF/MANIFEST.MF"

             includes="**"

        />

       

       <!-- war up ca-nim-sm.war -->

       <war destfile="${temp.dir}/ca-nim-sm.temp.war"

             webxml="${temp.dir}/ca-nim-sm.war/WEB-INF/web.xml"

             basedir="${temp.dir}/ca-nim-sm.war"

             manifest="${temp.dir}/ca-nim-sm.war/META-INF/MANIFEST.MF"

             includes="**"

       

        />

        <!-- remove exploded versions -->

        <delete dir="${temp.dir}/user_console.war"/>

        <delete dir="${temp.dir}/management_console.war"/>

        <delete dir="${temp.dir}/policyserver.rar"/>

        <delete dir="${temp.dir}/workflow.rar"/>

        <delete dir="${temp.dir}/identityminder_ejb.jar"/>

        <delete dir="${temp.dir}/ca-nim-sm.war"/>

       

        <!-- give created archives correct names -->

        <move file="${temp.dir}/user_console.temp.war" tofile="${temp.dir}/user_console.war"/>

        <move file="${temp.dir}/management_console.temp.war" tofile="${temp.dir}/management_console.war"/>

        <move file="${temp.dir}/policyserver.temp.rar" tofile="${temp.dir}/policyserver.rar"/>

        <move file="${temp.dir}/workflow.temp.rar" tofile="${temp.dir}/workflow.rar"/>

        <move file="${temp.dir}/identityminder_ejb.temp.jar" tofile="${temp.dir}/identityminder_ejb.jar"/>

        <move file="${temp.dir}/ca-nim-sm.temp.war" tofile="${temp.dir}/ca-nim-sm.war"/>

 

        <ear destfile="${basedir}/was_im.ear"

             appxml="${temp.dir}/META-INF/application.xml"

             basedir="${temp.dir}"

             includes="**"

            >

<!--            <fileset dir="${temp.dir}/config/" includes="**" /> -->

        </ear>

 

        <delete dir="${temp.dir}"/>

 

    </target>

 

</project>

 

    4)     Save and close the file

    5)     Run the following command to unpack the ear file :

         unpackage iam_im.ear C:\CA\AppServer

 

You should see the following output:

---------------------------------------------------------------------

Before you can run IDM WebSphere unpackaging tool, please, specify the location of the

Sun's JDK 1.3 or higher installed on your system.

The JDK you specify here will be used to drive the EAR packaging

./unpackage.sh: line 5: ehco: command not found

------------------------------------------------------------------------------

Your JAVA_HOME is currently set to C:\CA\AppServer\java. Please make sure it is correct.

------------------------------------------------------------------------------

---------------------------------------------------------------------

Set the proper class path

---------------------------------------------------------------------

Buildfile: C:\CA\AppServer\WebSphere-tools/unpack.xml

 

unpackage:

    [mkdir] Created dir: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

    [mkdir] Created dir: C:\CA\AppServer\WebSphere-ear/iam_im.ear

     [echo] Earpath: iam_im.ear

    [unjar] Expanding: C:\CA\AppServer\WebSphere-tools/iam_im.ear into C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

    [unjar] Expanding: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/user_console.temp.war into C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/user_console.war

    [unjar] Expanding: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/management_console.temp.war into C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/management_console.war

    [unjar] Expanding: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/policyserver.temp.rar into C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/policyserver.rar

    [unjar] Expanding: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/workflow.temp.rar into C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/workflow.rar

    [unjar] Expanding: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/identityminder_ejb.temp.jar into C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/identityminder_ejb.jar

    [unjar] Expanding: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/ca-nim-sm.temp.war into C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/ca-nim-sm.war

   [delete] Deleting: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/user_console.temp.war

   [delete] Deleting: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/management_console.temp.war

   [delete] Deleting: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/policyserver.temp.rar

   [delete] Deleting: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/workflow.temp.rar

   [delete] Deleting: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/identityminder_ejb.temp.jar

   [delete] Deleting: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/ca-nim-sm.temp.war

     [copy] Copying 6961 files to C:\CA\AppServer\WebSphere-ear/iam_im.ear

   [delete] Deleting directory C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

 

 

C) Apply the Fix (ie. wpClientServlet.jar )

Note : the file does not exists on the current EAR file. You will add the file

1)  Download  the wpClientServlet.jar (usually is Attached on support case)

2)  Navigate to...\iam_im.ear\user_console.war\WEB-INF\lib

3)  Copy the wpClientServlet.jar into , save and close the file.

 

Remove Duplicate Application.xml files

1)     Navigate to the C:\CA\AppServer\WebSphere-ear/iam_im.ear/META-INF directory

2)     Within the above directory, remove the application.xml.backup file.

         Note : This is used just a cleanup process 

 

D) Re-package the EAR file

 

1)     Navigate to the C:\CA\AppServer\WebSphere-tools directory

 

Run the following commands:

export JAVA_HOME=C:\CA\AppServer\java

 

./package.sh

 

2)     You should see the following message:

---------------------------------------------------------------------

Before you can run IDM WebSphere packaging tool, please, specify the location of the

Sun's JDK 1.3 or higher installed on your system.

The JDK you specify here will be used to drive the EAR packaging

---------------------------------------------------------------------

------------------------------------------------------------------------------

Your JAVA_HOME is currently set to C:\CA\AppServer\java. Please make sure it is correct.

------------------------------------------------------------------------------

---------------------------------------------------------------------

Set the proper class path

---------------------------------------------------------------------

Buildfile: C:\CA\AppServer\WebSphere-tools/package.xml

 

package:

    [mkdir] Created dir: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [copy] Copying 6961 files to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

      [war] Building war: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/user_console.temp.war

      [war] Building war: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/management_console.temp.war

      [jar] Building jar: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/policyserver.temp.rar

      [jar] Building jar: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/workflow.temp.rar

      [jar] Building jar: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/identityminder_ejb.temp.jar

      [war] Building war: C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/ca-nim-sm.temp.war

   [delete] Deleting directory C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/user_console.war

   [delete] Deleting directory C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/management_console.war

   [delete] Deleting directory C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/policyserver.rar

   [delete] Deleting directory C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/workflow.rar

   [delete] Deleting directory C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/identityminder_ejb.jar

   [delete] Deleting directory C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp/ca-nim-sm.war

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

     [move] Moving 1 file to C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

      [ear] Building ear: C:\CA\AppServer\WebSphere-tools/was_im.ear

      [ear] Warning: selected ear files include a META-INF/application.xml which will be ignored (please use appxml attribute to ear task)

   [delete] Deleting directory C:\CA\AppServer\WebSphere-tools/iam_im.ear_temp

 

BUILD SUCCESSFUL

Total time: 17 seconds

 

D) Update the EAR file in WebSphere

1)  In WAS console, Click on ApplicationsàApplication TypesàWebSphere enterprise Applications

 

screen04.jpg

 

2)  Click the checkbox next to iam_im application and click on update

 

screen05.jpg

 

3)  Select the Remote file system option and click on Browse 

screen06.jpg

 

 

4)  Navigate to the C:\CA\AppServer\WebSphere-tools, select the was_im.ear file and clock on OK

 

screen07.jpg

 

5)  Click on Next

 

screen08.jpg

 

 

6)  Click on Next

 

screen09.jpg

 

7)  Click on Next

 

screen10.jpg

 

 

8)  Select the Cluster and click on Apply, once done, click on Next

 

screen11.jpg

 

 

9)  Click on Finish

 

screen12.jpg

 

 

10)              The application update will now start

 

screen13.jpg

 

11)              Click on Save

 

screen14.jpg

 

 

12)              Wait for the changes to be synchronized and click on OK

 

screen15.jpg

 

13)              Start one of the CAIM JVMs

Additional Information: