[gatein-issues] [JBoss JIRA] Commented: (GTNPORTAL-1664) NPE if portlet information cannot be retrieved

Chris Laprun (JIRA) jira-events at lists.jboss.org
Mon Feb 14 08:38:13 EST 2011


    [ https://issues.jboss.org/browse/GTNPORTAL-1664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12582023#comment-12582023 ] 

Chris Laprun commented on GTNPORTAL-1664:
-----------------------------------------

@Khoi, while that could be a potential solution to the issue, there are two problems with this approach:
1. the ConsumerException doesn't mean that the portlet doesn't exist and such it's not semantically correct to wrap it into a NoSuchPortletException
2. UIPortlet should handle any kind of exception that gets thrown better regardless of what happens. The ConsumerException is caught in the generic catch block, however the only action that is taken is to print the stack trace which leaves the UIPortlet in an incorrect state.
The real solution is to properly handle any exceptions and put the UIPortlet in a state that is correct at all times.

> NPE if portlet information cannot be retrieved
> ----------------------------------------------
>
>                 Key: GTNPORTAL-1664
>                 URL: https://issues.jboss.org/browse/GTNPORTAL-1664
>             Project: GateIn Portal
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.1.0-GA
>            Reporter: Chris Laprun
>            Assignee: Khoi Nguyen
>              Labels: portal-s43, portal-s47
>             Fix For: 3.2.0-GA
>
>   Original Estimate: 4 hours
>  Remaining Estimate: 4 hours
>
> Caused by: java.lang.NullPointerException
> 	at org.exoplatform.portal.webui.application.UIPortlet.supportsPublicParam(UIPortlet.java:565)
> 	at org.exoplatform.portal.webui.application.UIPortlet.getPublicParameters(UIPortlet.java:683)
> 	at org.exoplatform.portal.webui.application.UIPortlet.create(UIPortlet.java:714)
> 	at org.exoplatform.portal.webui.application.UIPortletLifecycle.processRender(UIPortletLifecycle.java:186)
> Basically, in the following code:
> if (producedOfferedPortlet == null)
>          {
>             log.info("Could not find portlet with ID : " + producerOfferedPortletContext.getId());
>             return null;
>          }
> it's very likely that if producerOfferedPortlet is null, then the associated context is as well... hence the NPE.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the gatein-issues mailing list