[java.lang.ClassCastException: CustomPortlet is incompatible with javax.portlet.Portlet

I tried to create a portlet using MyEclipse after the MyEclipse Tutorial . I made all the slaps and exported the project as a WAR. When it is installed on the portal and placed on the page, he said: "This portlet is not available."

Find relevant discussion here .

The exception is: SRVE0068E: The exception was thrown by one of the [CustomPortlet] servlet service methods in the [PA_Vijay] application. Exception thrown: [java.lang.ClassCastException: CustomPortlet is incompatible with javax.portlet.Portlet

This is my Java code:

import java.io.IOException;
import java.io.PrintWriter;

import javax.portlet.GenericPortlet;
import javax.portlet.PortletConfig;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.UnavailableException;


public class CustomPortlet extends GenericPortlet {

    /**
     * Helper method to serve up the view mode.
     */

    public void init(PortletConfig pc)throws UnavailableException, PortletException{

        super.init(pc);
    }

    protected void doView(RenderRequest request, RenderResponse response)
            throws PortletException, IOException {
        response.setContentType("text/html");
        PrintWriter writer = response.getWriter();
        writer.print("<p>This is the custom portlet created from MyEclipseIDE</p>");
    }

}

Where is the problem?

+4
2

, -api.jar . , .

+2

eclipse, , Pluto. lib Websphere Portal.

  • Web-INF/lib .
  • Dynamic Web / websphere.
  • websphere .

,

0

All Articles