You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-user@portals.apache.org by Mike De Simone <mi...@rsmart.com> on 2004/03/05 15:25:42 UTC
Re: Error while dispatching portlet
I've seen similar things both while trying out the testsuite as well as my
own 'hello world' portlet. Unlike you, if I do something like the
following, things are fine:
PrintWriter pw = response.getWriter();
pw.write( "<br>Hello World!" );
[followed by pw.flush(); -- don't know if that's strictly necessary...]
However, if in the render() method, I do the following (which is basically
copied from the testsuite), I get errors:
if(renderRequest.getPortletMode().equals(PortletMode.VIEW)) {
jspName = getPortletConfig().getInitParameter("jspView");
rd = getPortletContext().getRequestDispatcher(jspName);
rd.include(renderRequest,renderResponse);
}
I'm running in tomcat 5.0.19 & have verified the existence of a pluto.xml
allowing cross context for /pluto
Here's the trace from the tomcat logs:
2004-03-04 16:10:47 ApplicationDispatcher[/portletWebapp] Servlet.service()
for servlet mikePortlet threw exception
java.lang.NullPointerException
at
org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRe
quest.java:546)
at
javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr
apper.java:260)
at
org.apache.pluto.core.impl.PortletRequestImpl.getPortletSession(PortletReque
stImpl.java:124)
at com.trg.portlettest.PortletTest.render(PortletTest.java:43)
at
org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:205)
at
org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:145)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
So, I'm at a loss here--the getSession() call fails. I tried to create the
session before doing the include(), to no avail. I.e., put this before the
'if' stmt: renderRequest.getPortletSession(true);
Have others gotten the include call to work with jsp's? I'm a little
confused because the spec [pg. 65] says you can only get dispatchers in the
render method, but in the testsuite, it's called in the overridden
doDispatch().
I know it's something silly, probably, but after staring at it for so long,
it's hard to see what to fix.
thanks for any suggestions.
[top of original message follows, reference:
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=pluto-user@jakarta.apach
e.org&msgId=1378330]
Hi
when I try to view my portlet, instead of my content ("Hello World"),
I'm getting "Error occurred in portlet!". In the Tomcat console I'm
getting the following errors.
Feb 23, 2004 11:13:36 AM
org.apache.pluto.portalImpl.services.log.LoggerImpl info
INFO: Initializing PortletContainer [pluto]...
Feb 23, 2004 11:13:40 AM
org.apache.pluto.portalImpl.services.log.LoggerImpl error
SEVERE: PortletInvokerImpl.render() - Error while dispatching portlet.
Feb 23, 2004 11:13:40 AM
org.apache.pluto.portalImpl.services.log.LoggerImpl error
SEVERE: Error in Portlet
Feb 23, 2004 11:13:41 AM
org.apache.pluto.portalImpl.services.log.LoggerImpl error
SEVERE: PortletInvokerImpl.render() - Error while dispatching portlet.
Feb 23, 2004 11:13:41 AM
org.apache.pluto.portalImpl.services.log.LoggerImpl error
SEVERE: Error in Portlet
Since this is a just a Hello World portlet, I think I must have some
beginner's error in one of my .xml files.
Any suggestions would be welcome
thanks
Markus
---------------------------
Mike De Simone
Mike De Simone
the r.smart group
602-840-7300 x106
ICQ: 161896611