portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Woonsan Ko <woon_...@yahoo.com>
Subject Re: NullPointerException when calling PortletURLImpl.toString() in websphere 6.0
Date Fri, 26 Jan 2007 04:35:16 GMT
Hi all,

I'm writing to dev list instead of user list.

In my opinion, it doesn't seem to have null name parameter in getAttribute() method.

According to Raman's stack trace and the related sources, InformationProviderServiceImpl class
calls 
ServletRequestImpl's getAttribute() with a literal parameter, 
"org.apache.jetspeed.engine.core.DynamicInformationProvider".

Therefore, I think we can add a workaround code for WebSphere here in
InformationProviderServiceImpl.java to just ignore NullPointerException like the following:


    public DynamicInformationProvider getDynamicProvider(javax.servlet.http.HttpServletRequest
request)
    {
        DynamicInformationProvider provider = null;
        try
        {
            provider = (DynamicInformationProvider)
request.getAttribute("org.apache.jetspeed.engine.core.DynamicInformationProvider");
        }
        catch (Exception e)
        {
            // some problem in WebSphere??
        }

        if (provider == null)
        {
            provider = new DynamicInformationProviderImpl(request, servletConfig);
            request.setAttribute("org.apache.jetspeed.engine.core.DynamicInformationProvider",
provider);
        }

        return provider;
    }


I think it would be possible to meet another exception after the try catch block, but I cannot
test with WebSphere 6 now.

Raman, would you test if the try catch block could be a workaround? And please let us know.
Thanks.


Regards,

Woonsan


--- David Sean Taylor <david@bluesunrise.com> wrote:

> 
> Tallamraju, Raman wrote:
> > 
> > The actual code snippet is
> > this:
> > 
> >     /**
> >      * @see
> > javax.servlet.http.HttpServletRequest#getAttribute(java.lang.String)
> >      */
> >     public Object getAttribute( String name )
> >     {
> >         ***Object value = super.getAttribute(name);***(Line 210)
> 
> Could this be caused by "name == null"?
> If so, I can add a check for
> 
> if (name == null)
>     return null;
> 
> and bypass making the super call
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 



 
____________________________________________________________________________________
Need a quick answer? Get one in minutes from people who know.
Ask your question on www.Answers.yahoo.com

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


Mime
View raw message