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

Calling a service should set the context class loader to the service implementation's class loader

    Details

      Description

      test-pacl-portlet -> calls sample-service-builder-portlet FooLocalService#getLocalObject()

      getLocalObject uses the context class loader to instantiate a "LocalObject" that only exists in the sample-service-builder-portlet class loader.

      PACLAdvice now serves both as an advice that detects permissions, and also as the advice that sets the context class loader to the proper class loader.

        Issue Links

          Activity

          Hide
          matthew.lee Matthew Lee (Inactive) added a comment -

          Committed on:
          Portal 6.2.x GIT ID: 18a8e1827c736dbcec81a6c26ec44c061ab80fe0.

          Show
          matthew.lee Matthew Lee (Inactive) added a comment - Committed on: Portal 6.2.x GIT ID: 18a8e1827c736dbcec81a6c26ec44c061ab80fe0.
          Hide
          sophia.zhang Sophia Zhang added a comment -

          Passed without word "FAILED" on:
          Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 0194e5337a7371291163a76a24d98f2417adaa27.
          Plugins 6.1.x.EE GIT ID: 0194e5337a7371291163a76a24d98f2417adaa27.
          Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 41e48149c61bea15b945e3704a5c8b69db507722.
          Plugins 6.2.x GIT ID: cfd99b7dc73eb0489d7b6cf242b0f10a70a01982.

          Deploying chat, flash, test-pacl and sample-service-builder plugins to test it.

          Show
          sophia.zhang Sophia Zhang added a comment - Passed without word "FAILED" on: Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 0194e5337a7371291163a76a24d98f2417adaa27. Plugins 6.1.x.EE GIT ID: 0194e5337a7371291163a76a24d98f2417adaa27. Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 41e48149c61bea15b945e3704a5c8b69db507722. Plugins 6.2.x GIT ID: cfd99b7dc73eb0489d7b6cf242b0f10a70a01982. Deploying chat, flash, test-pacl and sample-service-builder plugins to test it.
          Hide
          sophia.zhang Sophia Zhang added a comment -

          PASSED Manual Testing using the following steps:

          1. Deploy the latest test-pacl-portlet, sample-service-builder-portlet, Chat and Flash plugins to portal.
          2. Log in and add Test Pacl to a page.
          3. Check the following 2 lines pass:
          com.liferay.sampleservicebuilder.service.FooLocalServiceUtil.FooLocalServiceUtil#getFoosCount=PASSED
          com.liferay.sampleservicebuilder.service.FooLocalServiceUtil.FooLocalServiceUtil#getLocalObject=PASSED

          Reproduced on:
          Tomcat 7.0 + MySQL 5. 6.1.20 EE GA2.

          I got one line failed result:
          com.liferay.sampleservicebuilder.service.FooLocalServiceUtil.FooLocalServiceUtil#getFoosCount= PASSED
          com.liferay.sampleservicebuilder.service.FooLocalServiceUtil.FooLocalServiceUtil#getLocalObject= FAILED with com.liferay.sampleservicebuilder.util.LocalObject

          Fixed on:
          Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 0194e5337a7371291163a76a24d98f2417adaa27.
          Plugins 6.1.x.EE GIT ID: 0194e5337a7371291163a76a24d98f2417adaa27.
          Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 41e48149c61bea15b945e3704a5c8b69db507722.
          Plugins 6.2.x GIT ID: cfd99b7dc73eb0489d7b6cf242b0f10a70a01982.

          The 2 lines PASSED.

          Show
          sophia.zhang Sophia Zhang added a comment - PASSED Manual Testing using the following steps: 1. Deploy the latest test-pacl-portlet, sample-service-builder-portlet, Chat and Flash plugins to portal. 2. Log in and add Test Pacl to a page. 3. Check the following 2 lines pass: com.liferay.sampleservicebuilder.service.FooLocalServiceUtil.FooLocalServiceUtil#getFoosCount=PASSED com.liferay.sampleservicebuilder.service.FooLocalServiceUtil.FooLocalServiceUtil#getLocalObject=PASSED Reproduced on: Tomcat 7.0 + MySQL 5. 6.1.20 EE GA2. I got one line failed result: com.liferay.sampleservicebuilder.service.FooLocalServiceUtil.FooLocalServiceUtil#getFoosCount= PASSED com.liferay.sampleservicebuilder.service.FooLocalServiceUtil.FooLocalServiceUtil#getLocalObject= FAILED with com.liferay.sampleservicebuilder.util.LocalObject Fixed on: Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: 0194e5337a7371291163a76a24d98f2417adaa27. Plugins 6.1.x.EE GIT ID: 0194e5337a7371291163a76a24d98f2417adaa27. Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 41e48149c61bea15b945e3704a5c8b69db507722. Plugins 6.2.x GIT ID: cfd99b7dc73eb0489d7b6cf242b0f10a70a01982. The 2 lines PASSED.
          Hide
          brian.chan Brian Chan added a comment -

          Ok. The final fix no longer requires changes to PACLAdvice. Though fixing it in that one place fixes it everywhere, it was not as good on performance as fixing the generated code. So now, the fix is in service_base_impl.ftl. Portlets that require it need the fix pack to regenerate their services. Note that not regenerating is ok too if you're not running into this issue.

          Show
          brian.chan Brian Chan added a comment - Ok. The final fix no longer requires changes to PACLAdvice. Though fixing it in that one place fixes it everywhere, it was not as good on performance as fixing the generated code. So now, the fix is in service_base_impl.ftl. Portlets that require it need the fix pack to regenerate their services. Note that not regenerating is ok too if you're not running into this issue.
          Hide
          sophia.zhang Sophia Zhang added a comment -

          PASSED Manual Testing using my previous comment steps:

          Fixed on:
          Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: a84795cc7d2e0b270e23fd0c2cbcba573799f664.
          Plugins 6.1.x.EE GIT ID: e8f0a5c770251edbaa84c8f37b9ab6251aae2872.
          Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 4af25f75ba4917168d31ae3cfbe714260ac75e54.
          Plugins 6.2.x GIT ID: 4e5409936074ad2359e4814617cee5112c0d9522.

          The 2 lines PASSED using the final fix plugins.

          Show
          sophia.zhang Sophia Zhang added a comment - PASSED Manual Testing using my previous comment steps: Fixed on: Tomcat 7.0 + MySQL 5. Portal 6.1.x EE GIT ID: a84795cc7d2e0b270e23fd0c2cbcba573799f664. Plugins 6.1.x.EE GIT ID: e8f0a5c770251edbaa84c8f37b9ab6251aae2872. Tomcat 7.0 + MySQL 5. Portal 6.2.x GIT ID: 4af25f75ba4917168d31ae3cfbe714260ac75e54. Plugins 6.2.x GIT ID: 4e5409936074ad2359e4814617cee5112c0d9522. The 2 lines PASSED using the final fix plugins.

            People

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

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 14 weeks, 2 days ago

                Development

                  Subcomponents