• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

how to deploy portlet in pluto portal with tomcat server

Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all

i followed steps what ever given in "http://portals.apache.org/pluto/v11/deploying.html" of apache site.
Deploying Portlet to Pluto Portal with tomcat

There are 2 steps involved in deploying a portlet application in Pluto 1.1 or 2.0:

* Assembly : All portlet applications must be run through the pluto assembler before being deployed. The assembly process injects pluto specific information for deployment. Specifically, a servlet and servlet mapping are added to the deployment descriptor (web.xml). This servlet (org.apache.pluto.core.PortletServlet) will be used to dispatch portlet requests to the portlet application.
* Deployment : After portlet applications are assembled properly they must be deployed to the servlet engine within which the portal application is running. The current bundled distribution uses Tomcat 5.5 as the servlet engine.

Portlet Assembly

The maven-pluto-plugin can be used to assemble a portlet application war. It will place the proper PortletServlet configuration in web.xml.

The custom Maven 2 build shown below requires a Tomcat context deployment descriptor that has the same name as your artifactId with an xml extension (e.g. HelloWorldPortlet.xml).

To properly assemble your portlet using the Maven 2 plugin, your project's directory structure and artifact placement must conform to Maven's standard:

HelloWorldPortlet (top level directory)
|- pom.xml (the pom file)
|- src (Subdir containing main subdirectory)
|- main (Subdir containing java, resources and webapp subdirs)
|- java (java source code goes under here)
| `- com
| `- mycompany
| `- portlet
| `- HelloWorldPortlet.java (portlet source)
|- webapp (webapp resources (jsp, css, images) go under here)
`- jsp
`- HelloWorldPortletView.jsp (for view mode)
`- HelloWorldPortletEdit.jsp (for edit mode)
`- HelloWorldPortlet.xml (Tomcat context deployment descriptor)
`- portlet.xml (JSR-168 deployment descriptor)
`- web.xml (This will be modified by maven-pluto-plugin)

This is an example of what the Tomcat context deployment descriptor will contain:

<Context path="/HelloWorldPortlet"

To configure the maven-pluto-plugin, you must configure it in your pom. For easy of setup, use this as you pom file, changing the groupId, artifactId and version to values appropriate to your custom portlet.

<project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<!-- Change this to something akin to your java package structure -->
<!-- Version of this app -->
<!-- Base name of the war file without .war ext -->
<!-- Dependency Version Properties ======================================= -->
<!-- Change this to 2.0.0 for Pluto 2.0 or to another appropriate version -->
<scope>provided</scope><!-- Prevents addition to war file -->
<!-- Any other build or deployment dependancies go here -->
<!-- configure to use Java 6 to compile (change to your JDK) -->
<!-- configure maven-war-plugin to use updated web.xml -->
<!-- bind 'pluto:assemble' goal to 'generate-resources' lifecycle -->


Once configured, the war generated by an 'mvn package' (or install) command will contain the appropriate pluto configuration.
Portlet Deployment

To deploy a portlet application, simply deploy the application war using any standard mechanism for your application server. There are many maven plugins and ant tasks that can assist with this, or you can use an administrative web console. This console is the Tomcat manager webapp in the Pluto bundled distribution and is accessed via the 'Upload and deploy portlet war' link on the page administration portlet. See the Help link on that portlet for more details.

In the bundled distribution that uses Tomcat, deployment of an assembled war can simply be done by dropping the war into the webapps directory. You can automatically achive this by adding the following code within the plugins section of your maven pom.xml:

<property environment="env"/>
<!-- This assumes that you have set a CATALINA_HOME environmental variable -->
<property name="pluto.home" value="${env.CATALINA_HOME}"/>
<copy file="target/${pom.name}.war" todir="${pluto.home}/webapps"/>

Once the pom.xml file has been updated with this plugin, you can run the full build and deployment using the command: mvn integration-test. The code assumes that you have set the environmental variable CATALINA_HOME to the Pluto home directory. If that has not been done, just set pluto.home from the command line with the -D flag. The command line would then be: mvn -Dpluto.home=C:/pluto integration-test.
Portlet Publishing

As soon as the portlet application (war) is deployed to the servlet container the portlet application will be available to the portal and can be added to pages using the page administration portlet. See the help mode in this portlet for details on its use.

Portal Page Configuration

If you'd like for your page configuration to be consistent throughout restarts of the application server (currently placements made through the page administration portlet is not persistent), you should then configure the page layout in the portal-driver configuration file (pluto-portal-driver-config.xml).

The page can then be configured by adding a page child element of the render-config element, like this:

<render-config default="Test Page">
... ...
<page name="Your Portal Page Name" uri="/WEB-INF/fragments/portlet.jsp">
<portlet context="/your_portlet_app_context_path"
<portlet context="/your_portlet_app_context_path"

The uri attribute defines the theme of your portal page. If you use /WEB-INF/fragments/portlet.jsp (which is the default theme of Pluto Testsuite portlet app), your portlets will be displayed in two columns. You can clone this file to customize your layout. If you do so, make sure the uri attribute points to the new file.

i followed all steps which is given above , but when i executing thi sportlet in plutowith tomcat server portlet exception is coming.

i am trying from last 2 weeks to deployment of pluto portlet with tomcat but i didnot find exact solution for portlet with pluto tomcta server..

here code::::

please send details when any body find solution for that pluto deployment

Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic