You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by na...@reyrey.com on 2007/08/23 18:53:35 UTC

New Topic

Hi all,

I recently installed Jetspeed 2.1.2 on Linux with a MySQL DB and everything is working fine with one exception. I am encountering null pointers whenever I attempt to access the members of the PortletContext in my own portlets.  Here's a simple example that will fail:


public class GraphListPortlet extends GenericPortlet {
	protected void doView(RenderRequest request, RenderResponse response)
		throws PortletException, IOException
	{
		response.setContentType("text/html");

        PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/view.jsp");

        prd.include(request, response);


	}
}


The PortletRequestDispatcher will be received as null here and the include method will throw the exception.  Likewise if I attempt to access getPortletContext().getPortletContextName() it will also throw a NullPointerException.  I have stepped through the portlet using the Eclipse remote debug tool for Tomcat and have noticed that the servletContext inside the  JetspeedPortletConfig object is null, which seems to at least be the source of the getPorletContextName() problem (line 257 of JetspeedPortletContext.java attempts to access a member of that servletContext class). Any ideas on why this isn't initializing correctly? I haven't been able to find any problems with my portlet.xml or web.xml.

--
This message was sent on behalf of nate_ayres@reyrey.com at openSubscriber.com
http://www.opensubscriber.com/messages/jetspeed-user@portals.apache.org/topic.html

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: New Topic

Posted by Aaron Evans <aa...@gmail.com>.
I didn't see your later repost. Sounds like you got it figured out.

On 8/27/07, Aaron Evans <aa...@gmail.com> wrote:
> Just a shot in the dark but did you override init(PortletConfig
> config) and forget to call super.init(config)?
>
> I did that once and then had the behaviour you mention...
>
> On 8/23/07, nate_ayres@reyrey.com <na...@reyrey.com> wrote:
> > Hi all,
> >
> > I recently installed Jetspeed 2.1.2 on Linux with a MySQL DB and everything is working fine with one exception. I am encountering null pointers whenever I attempt to access the members of the PortletContext in my own portlets.  Here's a simple example that will fail:
> >
> >
> > public class GraphListPortlet extends GenericPortlet {
> >         protected void doView(RenderRequest request, RenderResponse response)
> >                 throws PortletException, IOException
> >         {
> >                 response.setContentType("text/html");
> >
> >         PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/view.jsp");
> >
> >         prd.include(request, response);
> >
> >
> >         }
> > }
> >
> >
> > The PortletRequestDispatcher will be received as null here and the include method will throw the exception.  Likewise if I attempt to access getPortletContext().getPortletContextName() it will also throw a NullPointerException.  I have stepped through the portlet using the Eclipse remote debug tool for Tomcat and have noticed that the servletContext inside the  JetspeedPortletConfig object is null, which seems to at least be the source of the getPorletContextName() problem (line 257 of JetspeedPortletContext.java attempts to access a member of that servletContext class). Any ideas on why this isn't initializing correctly? I haven't been able to find any problems with my portlet.xml or web.xml.
> >
> > --
> > This message was sent on behalf of nate_ayres@reyrey.com at openSubscriber.com
> > http://www.opensubscriber.com/messages/jetspeed-user@portals.apache.org/topic.html
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> > For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: New Topic

Posted by Aaron Evans <aa...@gmail.com>.
Just a shot in the dark but did you override init(PortletConfig
config) and forget to call super.init(config)?

I did that once and then had the behaviour you mention...

On 8/23/07, nate_ayres@reyrey.com <na...@reyrey.com> wrote:
> Hi all,
>
> I recently installed Jetspeed 2.1.2 on Linux with a MySQL DB and everything is working fine with one exception. I am encountering null pointers whenever I attempt to access the members of the PortletContext in my own portlets.  Here's a simple example that will fail:
>
>
> public class GraphListPortlet extends GenericPortlet {
>         protected void doView(RenderRequest request, RenderResponse response)
>                 throws PortletException, IOException
>         {
>                 response.setContentType("text/html");
>
>         PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/view.jsp");
>
>         prd.include(request, response);
>
>
>         }
> }
>
>
> The PortletRequestDispatcher will be received as null here and the include method will throw the exception.  Likewise if I attempt to access getPortletContext().getPortletContextName() it will also throw a NullPointerException.  I have stepped through the portlet using the Eclipse remote debug tool for Tomcat and have noticed that the servletContext inside the  JetspeedPortletConfig object is null, which seems to at least be the source of the getPorletContextName() problem (line 257 of JetspeedPortletContext.java attempts to access a member of that servletContext class). Any ideas on why this isn't initializing correctly? I haven't been able to find any problems with my portlet.xml or web.xml.
>
> --
> This message was sent on behalf of nate_ayres@reyrey.com at openSubscriber.com
> http://www.opensubscriber.com/messages/jetspeed-user@portals.apache.org/topic.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org