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

ServiceBuilder generates bad code in {Entity}LocalServiceClpInvoker class for functions without return value.

    Details

    • Branch Version/s:
      6.1.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      4

      Description

      Steps to reproduce:
      1) Create a portlet (named: servicebuilder-sample) with a service that has a simple entity e.g.:"Test" defined
      a) Extend the generated code with a custom method that has return type 'void' e.g.: TestLocalServiceImpl.testFunction()
      b) Re-run service-builder to propagate the changes into interfaces and classes
      2) Create a client portlet that uses the previous portlet's service
      a) Copy the servicebuilder-service.jar file from the first portlet from WEB-INF/lib/ to the client portlet's WEB-INF/lib/
      b) Modify the client portlet to call the first TestLocalServiceUtil.testFunction(), e.g.: from an actionURL
      3) Deploy the service and client portlets
      4) Add the client portlet to a page and execute the action method
      5) Watch the stacktraces roll by

      Caused by: java.lang.UnsupportedOperationException

      If we add logging to testFunction() like: _log.info("Test function invoked successfully.") then we will see this message in the server log before throwing UnsopportedOperationException

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  5 years, 1 week, 2 days ago