Deploy J2EE resources


Overview

You can manually pre-deploy portlet application WAR files using the WAS Administration console and later register them into WebSphere Portal, together with other J2EE resources and artifacts.

Portlet applications are usually packaged into single WAR files. These WAR files can be directly deployed into the portal by using portal administration means, for example, the Manage Web Modules portlet or the xmlaccess.sh. The portal administration functions manage the correct deployment and configuration into both WAS and WebSphere Portal.

You might want to deploy portlet applications together with EJBs, or bundle several WAR files into the same EAR file, or work with similar scenarios. For this type of requirement WebSphere Portal provides the predeployed mode with the xmlaccess.sh. It allows you to configure portlet applications into the portal which you predeployed into the application server as part of a larger EAR file.

You deploy the EAR file into the application server by means of the application server administration interfaces, such as the Administration console or the wsadmin command line tool. Once you have deployed the EAR file into the application server you can use the portal xmlaccess.sh to perform the portal specific configuration steps that are required to configure the available portlet application(s). To do this...

  1. Bundle the portlet application(s) that you want to register together with other J2EE resources as an EAR file.

  2. Deploy this EAR file into WAS using either wsadmin.sh or the Administration console.

    Take note of target directory to which you deploy the EAR file; this is needed for creating the XML file in the next step.

    Make sure that the Web modules in the EAR file are deployed with the same server and virtual host mappings as the portal.

  3. Create a portal XML script file that deploys and configures the portlet application(s) deployed with the EAR file.

  4. Execute the XML script using the portal xmlaccess.sh.

After you have performed these steps, the portlet is ready for use.

  1. You can register predeployed applications into the portal only by using the xmlaccess.sh. Once you have registered a predeployed application, the Manage Web Modules portlet shows this application.

  2. You can later use the portal administration portlets to remove the portlet definitions from the portal database. However, this does not remove the EAR file from WAS.

  3. You can update a predeployed portlet application only by using the xmlaccess.sh.

  4. You cannot update a deployed portlet application WAR file with a predeployed EAR file and vice versa. To change between the two types of files, you need to delete the existing portlet application and deploy the new one. However, deleting the existing portlet application will also delete all configuration data of that application. A predeployed application can only be updated via update of the EAR file in WAS and subsequent update of the contained WAR file in portal by using the xmlaccess.sh. Cross updates of a predeployed EAR file with a real WAR and vice versa are not possible.

  5. The WAS administrator must take care of correctly configuring the dispatch mechanisms for these applications.

For more information about the xmlaccess.sh and how to use it refer to xmlaccess.sh. The sample XML file RegisterPreDeployedEAR.xml shows you an example for deploying and configuring a predeployed portlet.

The following table shows the differences between WAR and EAR deployment:

Affected portal area WAR file Predeployed EAR file
Portlet application Provided as WAR file. The portal configuration is read directly from the file stream. The WAR file is deployed into the application server by the portal. Already extracted and deployed into the application server as part of the EAR file. The portal server reads the available portal configuration information (portlet.xml, etc.) from the location where the contained WAR file was extracted to.
Context Root Assigned by the portal during WAR deployment. Assigned by the EAR developer and stored in the file application.xml. Ensure that the context root that you specify when you register the portlet matches the one specified in the EAR application.xml. Refer to RegisterPreDeployedEAR.xml
Display name Assigned by Portal during WAR deployment. Assigned by the EAR developer and stored in the file application.xml.
WAS policy for portlet applications Stored in the WAR file and promoted to the EAR file by the portal during WAR deployment. Stored in the EAR file.
Portlet administration Administer WAR files using the xmlaccess.sh and the administration portlets. You can register EAR files only by using an XML script with predeployed mode. You can remove EAR files by using either the administration portlet or an XML script.


Parent

Manage portlets and portlet applications
xmlaccess.sh
Sample XML configuration files

 


+

Search Tips   |   Advanced Search