• 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

problems showing a very simple portlet in pluto

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm getting the following exception when trying to show a very simple helloworldportlet in pluto. Any ideas?

java.lang.NullPointerException
at org.apache.pluto.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:109)
at org.apache.pluto.invoker.impl.PortletInvokerImpl.load(PortletInvokerImpl.java:80)
at org.apache.pluto.PortletContainerImpl.portletLoad(PortletContainerImpl.java:218)
at org.apache.pluto.portalImpl.core.PortletContainerWrapperImpl.portletLoad(PortletContainerWrapperImpl.java:94)
at org.apache.pluto.portalImpl.aggregation.PortletFragment.service(PortletFragment.java:120)
at org.apache.jsp.WEB_002dINF.aggregation.ColumnFragment_jsp._jspService(org.apache.jsp.WEB_002dINF.aggregation.ColumnFragment_jsp:65)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)


Daniel
 
author and cow tipper
Posts: 5001
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's not alot of data here to go on. Perhaps you've set the content type to null?

Show some code, maybe we can help you.

-Cameron McKenzie
 
Daniel Amadei
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Cameron,

This is the portlet. BTW, I'm deploying it in Pluto.


public class HelloWorldPortlet extends GenericPortlet {

protected void doView(RenderRequest request,
RenderResponse response)
throws PortletException, IOException {

response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<h1>Hello World</h1>");
}
}

[]s
Daniel
 
Daniel Amadei
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Cameron,

This is my portlet.xml as you asked.

<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">

<portlet>
<description>This is my first portlet.</description>
<portlet-name>HelloWorldPortlet</portlet-name>
<display-name>Hello World Portlet</display-name>
<portlet-class>hwp.HelloWorldPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<portlet-info>
<title>HelloWorld</title>
</portlet-info>
</portlet>

</portlet-app>
 
Daniel Amadei
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Cameron,

I found out why I was in trouble. Pluto requires the definition of a Servlet for each portlet in the webapp. So I had to add the following to my web.xml:

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

<servlet-mapping>
<servlet-name>HelloWorldPortlet</servlet-name>
<url-pattern>/PlutoInvoker/HelloWorldPortlet</url-pattern>
</servlet-mapping>
 
Cameron Wallace McKenzie
author and cow tipper
Posts: 5001
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I remember having to do that with the old JetSpeed API, but not with JSR168. Of course, I've never used Pluto, so I'm a bit over my head in that regard.

I'm glad you fixed it.

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