You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by Valerie Lavilla <bm...@yahoo.com> on 2004/12/22 18:37:49 UTC

Null Pointer exception

Anybody knows why this returns a NullPointer
exception? And how to fix it?
 
PortletSession sess = req.getPortletSession(); 
PortletContext ctxt = sess.getPortletContext(); 



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - 250MB free storage. Do more. Manage less. 
http://info.mail.yahoo.com/mail_250

Re: Null Pointer exception

Posted by Valerie Lavilla <bm...@yahoo.com>.
this is the stack trace. Thanks:

java.lang.NullPointerException 
        at
org.apache.pluto.core.impl.PortletSessionImpl.getInternalPortletContext(PortletSessionImpl.java:242)

        at
org.apache.pluto.core.impl.PortletSessionImpl.getPortletContext(PortletSessionImpl.java:199)

        at
net.carefx.portlet.SurveyPortlet.doView(SurveyPortlet.java:44)

        at
javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:250)

        at
javax.portlet.GenericPortlet.render(GenericPortlet.java:178)

        at
net.carefx.portalContext.portlet.ContextPortlet.render(ContextPortlet.java:722)

        at
org.apache.jetspeed.container.JetspeedContainerServlet.doGet(JetspeedContainerServlet.java:234)

        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)

        at
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)

        at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)

        at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)

        at
org.apache.jetspeed.container.invoker.ServletPortletInvoker.invoke(ServletPortletInvoker.java:213)

        at
org.apache.jetspeed.container.invoker.ServletPortletInvoker.render(ServletPortletInvoker.java:124)

        at
org.apache.pluto.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:103)


--- "David H. DeWolf" <dd...@apache.org> wrote:

> Please provide the stack trace as well.
> 
> Thanks,
> 
> David
> 
> Valerie Lavilla wrote:
> > It's being called in the doView() method. When
> that
> > code is being executed, null pointer exception is
> > being generated. From what I've been told sessions
> > can't return null. If there are no sessions
> defined,
> > it'll create its own. Right? Thanks.
> > 
> > --- Ken Ramirez <kr...@TheJavaThinkTank.org>
> wrote:
> > 
> > 
> >>Need more details...
> >>
> >>1. Where are these calls being made? processAction
> >>or doView
> >>
> >>2. What are the circumstances surrounding the
> call?
> >>Has the user seen a 
> >>page with a link and clicked on the link to arrive
> >>at the method that 
> >>calls getPortletSession and getPortletContext.
> >>
> >>3. How are you defining the context?
> >>
> >>Thanks,
> >>
> >>Ken
> >>
> >>Valerie Lavilla wrote:
> >>
> >>
> >>>Anybody knows why this returns a NullPointer
> >>>exception? And how to fix it?
> >>>
> >>>PortletSession sess = req.getPortletSession(); 
> >>>PortletContext ctxt = sess.getPortletContext(); 
> >>>
> >>>
> >>>
> >>>		
> >>>__________________________________ 
> >>>Do you Yahoo!? 
> >>>Yahoo! Mail - 250MB free storage. Do more. Manage
> >>
> >>less. 
> >>
> >>>http://info.mail.yahoo.com/mail_250
> >>> 
> >>>
> >>
> >>-- 
> >>
> > 
> >
>
*----*----*----*----*----*----*----*----*----*----*----*----
> > 
> >>Stay on top of all things to do with JSR-168
> Portlet
> >>and
> >>Portal development by bookmarking the authority on
> >>the
> >>subject: http://community.java.net/portlet
> >>*
> >>* News
> >>* Weblogs
> >>* Community Tips
> >>* Portlet and Portal Projects
> >>* Featured Articles
> >>* And much more
> >>*
> >>
> > 
> >
>
*----*----*----*----*----*----*----*----*----*----*----*----
> > 
> >>Ken Ramirez
> >>Send mail to:
> mailto://kramirez@TheJavaThinkTank.org
> >>Check out the website:
> >>http://www.TheJavaThinkTank.org
> >>Check out my Blog at:
> >>http://weblogs.java.net/blog/ken_ramirez
> >>
> > 
> >
>
*----*----*----*----*----*----*----*----*----*----*----*----
> > 
> >>
> > 
> > 
> > 
> > 		
> > __________________________________ 
> > Do you Yahoo!? 
> > All your favorites on one personal page � Try My
> Yahoo!
> > http://my.yahoo.com 
> > 
> 



		
__________________________________ 
Do you Yahoo!? 
Jazz up your holiday email with celebrity designs. Learn more. 
http://celebrity.mail.yahoo.com

Re: Null Pointer exception

Posted by "David H. DeWolf" <dd...@apache.org>.
Please provide the stack trace as well.

Thanks,

David

Valerie Lavilla wrote:
> It's being called in the doView() method. When that
> code is being executed, null pointer exception is
> being generated. From what I've been told sessions
> can't return null. If there are no sessions defined,
> it'll create its own. Right? Thanks.
> 
> --- Ken Ramirez <kr...@TheJavaThinkTank.org> wrote:
> 
> 
>>Need more details...
>>
>>1. Where are these calls being made? processAction
>>or doView
>>
>>2. What are the circumstances surrounding the call?
>>Has the user seen a 
>>page with a link and clicked on the link to arrive
>>at the method that 
>>calls getPortletSession and getPortletContext.
>>
>>3. How are you defining the context?
>>
>>Thanks,
>>
>>Ken
>>
>>Valerie Lavilla wrote:
>>
>>
>>>Anybody knows why this returns a NullPointer
>>>exception? And how to fix it?
>>>
>>>PortletSession sess = req.getPortletSession(); 
>>>PortletContext ctxt = sess.getPortletContext(); 
>>>
>>>
>>>
>>>		
>>>__________________________________ 
>>>Do you Yahoo!? 
>>>Yahoo! Mail - 250MB free storage. Do more. Manage
>>
>>less. 
>>
>>>http://info.mail.yahoo.com/mail_250
>>> 
>>>
>>
>>-- 
>>
> 
> *----*----*----*----*----*----*----*----*----*----*----*----
> 
>>Stay on top of all things to do with JSR-168 Portlet
>>and
>>Portal development by bookmarking the authority on
>>the
>>subject: http://community.java.net/portlet
>>*
>>* News
>>* Weblogs
>>* Community Tips
>>* Portlet and Portal Projects
>>* Featured Articles
>>* And much more
>>*
>>
> 
> *----*----*----*----*----*----*----*----*----*----*----*----
> 
>>Ken Ramirez
>>Send mail to: mailto://kramirez@TheJavaThinkTank.org
>>Check out the website:
>>http://www.TheJavaThinkTank.org
>>Check out my Blog at:
>>http://weblogs.java.net/blog/ken_ramirez
>>
> 
> *----*----*----*----*----*----*----*----*----*----*----*----
> 
>>
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> All your favorites on one personal page – Try My Yahoo!
> http://my.yahoo.com 
> 

Re: Null Pointer exception

Posted by Valerie Lavilla <bm...@yahoo.com>.
It's being called in the doView() method. When that
code is being executed, null pointer exception is
being generated. From what I've been told sessions
can't return null. If there are no sessions defined,
it'll create its own. Right? Thanks.

--- Ken Ramirez <kr...@TheJavaThinkTank.org> wrote:

> Need more details...
> 
> 1. Where are these calls being made? processAction
> or doView
> 
> 2. What are the circumstances surrounding the call?
> Has the user seen a 
> page with a link and clicked on the link to arrive
> at the method that 
> calls getPortletSession and getPortletContext.
> 
> 3. How are you defining the context?
> 
> Thanks,
> 
> Ken
> 
> Valerie Lavilla wrote:
> 
> >Anybody knows why this returns a NullPointer
> >exception? And how to fix it?
> > 
> >PortletSession sess = req.getPortletSession(); 
> >PortletContext ctxt = sess.getPortletContext(); 
> >
> >
> >
> >		
> >__________________________________ 
> >Do you Yahoo!? 
> >Yahoo! Mail - 250MB free storage. Do more. Manage
> less. 
> >http://info.mail.yahoo.com/mail_250
> >  
> >
> 
> -- 
>
*----*----*----*----*----*----*----*----*----*----*----*----
> Stay on top of all things to do with JSR-168 Portlet
> and
> Portal development by bookmarking the authority on
> the
> subject: http://community.java.net/portlet
> *
> * News
> * Weblogs
> * Community Tips
> * Portlet and Portal Projects
> * Featured Articles
> * And much more
> *
>
*----*----*----*----*----*----*----*----*----*----*----*----
> Ken Ramirez
> Send mail to: mailto://kramirez@TheJavaThinkTank.org
> Check out the website:
> http://www.TheJavaThinkTank.org
> Check out my Blog at:
> http://weblogs.java.net/blog/ken_ramirez
>
*----*----*----*----*----*----*----*----*----*----*----*----
> 
> 



		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com 

Re: Null Pointer exception

Posted by Ken Ramirez <kr...@TheJavaThinkTank.org>.
Need more details...

1. Where are these calls being made? processAction or doView

2. What are the circumstances surrounding the call? Has the user seen a 
page with a link and clicked on the link to arrive at the method that 
calls getPortletSession and getPortletContext.

3. How are you defining the context?

Thanks,

Ken

Valerie Lavilla wrote:

>Anybody knows why this returns a NullPointer
>exception? And how to fix it?
> 
>PortletSession sess = req.getPortletSession(); 
>PortletContext ctxt = sess.getPortletContext(); 
>
>
>
>		
>__________________________________ 
>Do you Yahoo!? 
>Yahoo! Mail - 250MB free storage. Do more. Manage less. 
>http://info.mail.yahoo.com/mail_250
>  
>

-- 
*----*----*----*----*----*----*----*----*----*----*----*----
Stay on top of all things to do with JSR-168 Portlet and
Portal development by bookmarking the authority on the
subject: http://community.java.net/portlet
*
* News
* Weblogs
* Community Tips
* Portlet and Portal Projects
* Featured Articles
* And much more
*
*----*----*----*----*----*----*----*----*----*----*----*----
Ken Ramirez
Send mail to: mailto://kramirez@TheJavaThinkTank.org
Check out the website: http://www.TheJavaThinkTank.org
Check out my Blog at: http://weblogs.java.net/blog/ken_ramirez
*----*----*----*----*----*----*----*----*----*----*----*----