+

Search Tips   |   Advanced Search

Deploy portlets common across clusters


We can deploy portlets as a standard EAR through the dmgr and then notify each cluster. A pre-deployed application can only be updated by updating the EAR file in IBM WebSphere Application Server and subsequently updating the contained WAR file using xmlaccess.sh. Cross updates of a pre-deployed EAR file with a real WAR and vice versa are not possible. We can also install it as a standard portlet within one cluster, then map the underlying enterprise application to the other cluster and use xmlaccess.sh to notify the other cluster members. For simplicity and ease of administration, common portlet applications should be administered as standard EARs first, so there is no need to remember which cluster owns the original deployment.

To deploy common portlets:

  1. Install the EAR through dmgr, using either the Applications > Install New Application option within the WAS admin console, or the AdminApp install command within the wsadmin scripting client. This allows portlets to be combined with other EAR resources, such as web services, Enterprise Java Beans, or other web modules.

  2. Map the application to each cluster where it is to run, using either the MapModulesToServers option of the AdminApp install command within the wsadmin scripting client, or the Map modules to servers option under that application’s entry under Applications > Enterprise Applications.

  3. Synchronize the new application with each node in all clusters, and then start the application in each cluster. By default, synchronization will automatically occur with each node hosting servers and cluster members, or both, to which the enterprise application is mapped.

  4. Use xmlaccess.sh to import a portlet definition into each cluster using the predeployed attribute, where the <url> element of the <web-app> points to the binaries directory where the portlet application's WAR contents are contained. Choose only one cluster member in a cluster against which to run xmlaccess.sh, and as a result all cluster members receive the update.

Here is an example XML definition for importing a pre-deployed portlet application using xmlaccess.sh:

<web-app action="update" active="true" uid="com.ibm.wps.portlets.welcome" predeployed="true">
    <url>file://c:/ibm/WebSphere/PortalServer/installedApps/WelcomePortlet.ear/WelcomePortlet.war</url>

    <!-- The context root assigned to the web application of the portlet application 
         in the predeployed EAR file (reference: application.xml). The context-root 
         in this XML file must match with the context-root in the application.xml file.   -->
    <context-root>my/context/root</context-root>

    <!-- The name assigned to the application in the predeployed EAR file 
         (reference: application.xml). -->
    <display-name>My_Web_App</display-name>

    <portlet-app action="update" active="true" uid="com.ibm.wps.portlets.welcome.1">
        <portlet action="update" active="true" objectid="theIbmPortletApiPortlet" name="Welcome Portlet"/>
    </portlet-app>
</web-app>


Parent: Manage portlets in the cluster
Related:
xmlaccess.sh
Related:

wsadmin scripting tool