Reputation: 221
I tried creating portlet using MyEclipse following MyEclipse tutorial. I did all the stesps and exported project as WAR. When installed it to the Portal and put it on a page, it said "This portlet is unavailable".
Find the related discussion here.
The exception is: SRVE0068E: An exception was thrown by one of the service methods of the servlet [CustomPortlet] in application [PA_Vijay]. Exception created : [java.lang.ClassCastException: CustomPortlet 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 lies the problem?
Upvotes: 4
Views: 1586
Reputation: 28
Portlet capability in eclipse is probably creating the project for Pluto server. The jars in the lib folder maybe conflicting with the Websphere Portal runtime.
Hope this helps
Upvotes: 0
Reputation: 12538
Check that you don't deploy the portlet-api.jar with your application. If you deploy it with your application it can cause problems.
Upvotes: 2