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

    • Oracle Sun JDK 8
    • 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

            support-lep@liferay.com SE Support
            michael.chen1 Michael Chen
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              27 weeks, 3 days ago

              Packages

                Version Package