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

Groovy scripts cannot import classes from other OSGI modules

Details

    Description

      Script engines were extracted to OSGI modules at LPS-55489

      As they are isolated in their own OSGI bundle, they cannot import and invoke to classes from other OSGI modules.

      This is very problematic for support team as sometimes we need to send groovy scripts to customers in order to get or fix data.

      Steps to reproduce:

      1. Open Server Administration => Script
      2. Copy following groovy script
        import com.liferay.journal.service.JournalArticleLocalServiceUtil;
        System.out.println("It works!");
        
      3. Click "execute":
        • Wrong behavior: A compilation error is thrown at liferay log
          Script2.groovy: 1: unable to resolve class com.liferay.journal.service.JournalArticleLocalServiceUtil
           @ line 1, column 1.
             import com.liferay.journal.service.JournalArticleLocalServiceUtil;
             ^
          
        • Expected behavior: A It works message is shown at liferay log
          It works!
          

      Attachments

        Issue Links

          Activity

            People

              mark.jin Mark Jin (Inactive)
              jorge.diaz Jorge Diaz
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                7 years, 21 weeks, 2 days ago

                Packages

                  Version Package
                  7.0.0 M7