Probably the problem that you are having is related to:

>       <servlet-class>javax.portlet.GenericPortlet
>       </servlet-class>

This is in an incorrect way to map the servlet.  This class should be
 org.apache.pluto.core.PortletServlet.

GenericPortlet is an abstract class; this is why you get
java.lang.InstantiationException.  Even if it was concrete, you probably
get a ClassCastException because it is not a servlet.

Here is a correct mapping for Pluto's AboutPortlet taken from:
http://svn.apache.org/viewvc/portals/pluto/tags/pluto-1.1.4/pluto-portal/src/main/webapp/WEB-INF/web.xml?view=markup

  <servlet>
    <servlet-name>AboutPortlet</servlet-name>
    <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
    <init-param>
      <param-name>portlet-name</param-name>
      <param-value>AboutPortlet</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

To answer some of your other questions:

> Why an abstract class? Why not an interface?

javax.portlet.GenericPortlet provides some basic logic for holding
instances of the portlet API object and for routing requests based on the
default supported modes.  javax.portlet.Portlet is the interface in this
case; GenericPortlet is just a convenient implementation.

> Also, what is the purpose of
> org.apache.pluto.core.PortletServlet that is used in the testsuite that
> came with Pluto-1.1.4.

Pluto dispatches requests to portlets by wrapping them in
o.a.p.core.PortletServlet.  This makes it possible for them to easily take
advantage the classloading and lifecycle functionality of the servlet
container.  That is the only reason why they must be mapped in web.xml. 
Usually, if you utilize the Pluto maven plugin or ant task, you should not
have to include these mappings manually.  It is good practice to use these
tools, because other containers will not be able to handle the Pluto
mappings anyhow.  Here is a good rule of thumb that could help you out
though:

Only include instances of javax.servlet.Servlet in web.xml.
Only include instances of javax.portlet.Portlet in portlet.xml.

Hope this helps,

Ben

Reply via email to