+

Search Tips   |   Advanced Search

Deploy J2EE resources


We can manually pre-deploy portlet application WAR files using the WAS admin 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 using portal administration means, for example, the Manage Web Modules portlet or 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 us 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 WAS admin console or the wsadmin.sh. Once you have deployed the EAR file into the application server we can use the portal xmlaccess.sh to perform the portal specific configuration steps required to configure the available portlet application(s).



Deploy J2EE resources

  1. Bundle the portlet applications and other J2EE resources as an EAR file.

  2. Deploy this EAR file into WAS.

    Use wsadmin.sh or the WAS admin console.

    Note EAR file target directory; this is needed for creating the XML file in the next step.

    Deploy the Web modules in the EAR file using the same server/cluster and virtual host mappings as the portal.

  3. Register the portlet applications...

    Once you have registered a predeployed application, the Manage Web Modules portlet shows this application.

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

We can update a predeployed portlet application only using xmlaccess.sh.

We cannot update a deployed portlet application WAR file with a predeployed EAR file and vice versa. To change between the two types of files...

  1. Delete the existing portlet application
  2. Deploy the new one

Deleting the existing portlet application will also delete all configuration data on 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 using xmlaccess.sh. Cross updates of a predeployed EAR file with a real WAR and vice versa are not possible.


Differences between WAR and EAR deployment

Affected area WAR file Predeployed EAR file
Portlet application The portlet application is 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. The portlet application is 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 The context root is assigned by the portal during WAR deployment. The context root is assigned by the EAR developer and stored in the file application.xml. You must ensure that the context root that we specify when you register the portlet matches the one specified in the EAR application.xml.
Display name The display name is assigned by Portal during WAR deployment. The display name is assigned by the EAR developer and stored in the file application.xml.
WAS policy for portlet applications The policy is stored in the WAR file and promoted to the EAR file by the portal during WAR deployment. The policy is stored in the EAR file.
Portlet administration You administer WAR files using xmlaccess.sh and the administration portlets. We can register EAR files only using an XML script with predeployed mode. We can remove EAR files using either the administration portlet or an XML script.


Parent: Manage portlets, portlet applications, and iWidgets
Related:
xmlaccess.sh
Related reference:
Sample XML configuration files