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

Anonymous IndexableActionableDynamicQuery created by JournalArticle wrapper requires another local service reference

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 7.0.X, 7.1.X, 7.2.X, 7.3.X, Master
    • Fix Version/s: None
    • Component/s: Portal Services
    • Labels:
      None
    • JDK:
      Oracle Sun JDK 8
    • Application Servers:
      Apache Tomcat 8.0.x

      Description

      A JournalArticleWrapper class that overrides this method will throw a "java.lang.IllegalStateException: No current transaction executor" during JournalArticle reindex:

      public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
      {
      	IndexableActionableDynamicQuery query = new IndexableActionableDynamicQuery() {
      		@Override
      		public void performActions() throws PortalException {
      			//...
      			super.performActions();
      			//...
      		}
      	};
      	query.setBaseLocalService(getWrappedService());
      	query.setClassLoader(getWrappedService().getClass().getClassLoader());
      	//...
      	return query;
      }
      @Reference(unbind = "-")
      JournalArticleLocalService journalArticleLocalService;
      

      The workaround is to declare yet another reference to JournalArticleLocalService, then use that to call:

      	query.setBaseLocalService(journalArticleLocalService);
      

      It doesn't make sense having to declare another JournalArticleLocalService inside a JournalArticleLocalServiceWrapper, while the next line using 'getWrappedService()' to set class loader works fine.

      Source code, build module and exception logs are in the attached zip archive.

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            michael.chen1 Michael Chen
            Participants of an Issue:
            Recent user:
            Michael Chen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              1 year, 15 weeks, 6 days ago

                Packages

                Version Package