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

Liferay's bnd-plugin shouldn’t be emitting the package imports for packages that exist in the Host bundle

    Details

    • Fix Priority:
      5
    • OS:
      Ubuntu LTS 14.04
    • JDK:
      Oracle Sun JDK 8
    • Application Servers:
      Apache Tomcat 9.0.x
    • Browsers:
      Chrome (latest)
    • Databases:
      MySQL 5.7
    • Device Type:
      Desktop

      Description

      I have created a JSP Fragment module that is used to customize the rendering of the Search Results Portlet view.jsp. Here is what I did:

      1. Create a JSP fragment for host com.liferay.portal.search.web and version 3.0.33
      2. In the resources folder, create a folder called search
      3. in the resources/search folder create a folder called results
      4. In the resources/search/results folder add the view.jsp from the 7.1 GA2 code base
      5. Validate that the bnd for the module has: Fragment-Host: com.liferay.portal.search.web;bundle-version="3.0.33"
      6. Update the view.jsp, making a change to the markup - I added a test header 
      7. Deploy the module
      8. Perform a search and notice that the test header doesn't show

      Expected Result:

      The module should be in a Resolved state

      Actual Result:

      The module is in an Installed state

      Troubleshooting:

      1. Connect to the gogo shell and lb
      2. Notice that the fragment is in an Installed state, not a resolved state
      3. In the gogo shell, execute: diag <id>
      4. You should get an error stating: Unresolved requirement: Import-Package: com.liferay.portal.search.web.internal.result.display.context
      5. These imports should be implicit since the jsp will be part of the same classloader in the end. So even though the import statements are using "internal" classes, they will be available. 

      Work around:

      You can work around this by adding the following to the bnd for the jsp fragment module

      Import-Package:\
      !com.liferay.portal.search.web.internal.*,\
      *

      .. but I don't think it should be required. It certainly wasn't in Liferay 7.0.x

       

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Days since last comment:
                35 weeks, 4 days ago

                Packages

                Version Package