Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-22089

Null Pointer exception on adding a consumer for a remote webcenter producer that does not specify any registration properties

Details

    • Bug
    • Status: Closed
    • Resolution: Fixed
    • 6.0.12 EE, 6.1.0 CE RC1
    • --Sprint 12/11, 6.1.0 CE RC1
    • Accessibility
    • I'm trying to add a consumer for a producer deployed in Webcenter. The Webcenter runs on a remote machine. Liferay is running on my local machine.

    Description

      Steps:
      1. Add a consumer using the producer WSDL obtained in Webcenter
      2. Click on Actions. There is no Manage Portlet option.
      3. Click on Edit Registration

      Error on screen to the effect that the remote WSRP portlet is unavailable.

      A Null Pointer Exception is thrown and Tomcat log shows the following entry.

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: org.apache.jasper.JasperException: An exception occurred processing JSP page /a
      dmin/edit_consumer_registration.jsp at line 120

      117:
      118: List resultRows = searchContainer.getResultRows();
      119:
      120: for (int i = 0; i < propertyDescriptions.length; i++) {
      121: PropertyDescription propertyDescription = propertyDescriptions;
      122:
      123: String fullyQualifiedName = propertyDescription.getName().toString();

      Stacktrace:
      at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrappe
      r.java:510)

      Looking at edit-consumer_registration.jsp (liferay-portal-6.0.6\tomcat-6.0.29\webapps\wsrp-portlet\admin), turns out their is no checking for when the propertyDescriptions array is null. It is initialised properly but if Inband registration is supported, it gets overwritten by a value which can be null.

      [Excerpt from edit-consumer_registration.jsp]

      PropertyDescription[] propertyDescriptions = new PropertyDescription[0];

      if (supportsInbandRegistration) {
      propertyDescriptions = wsrpConsumerManager.getPropertyDescriptions();
      }

      This corresponds to Liferay forum post
      http://www.liferay.com/community/forums/-/message_boards/message/11071120

      The problem can be easily rectified by

      • either a null check on the array
      • or changing the WSRPConsumerManager so that it does not return a null value.

      Attachments

        Activity

          People

            paul.piao Paul Piao (Inactive)
            adibart Aditi Barthwal (Inactive)
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11 years, 12 weeks, 3 days ago

              Packages

                Version Package
                --Sprint 12/11
                6.1.0 CE RC1