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

Setting model class names into SearchRequest/SearchRequestBuilder fails if model is not from portal-kernel

    Details

      Description

      The new methods created as requested in LPS-123613 fail to work when the given model class name is for a model found in some module, instead of portal-kernel.

      Steps to reproduce

      • Execute SearchRequestBuilderTest integration test (with gw tI --tests *SearchRequestBuilderTest from inside portal-search-test).

      Expected results

      • The test would pass.

      Actual results

      • The test fails with this message:
      com.liferay.portal.search.searcher.test.SearchRequestBuilderTest > testModelIndexerClassNames FAILED
          java.lang.AssertionError: {level=ERROR, loggerName=com.liferay.portal.search.internal.searcher.SearchRequestImpl, message=java.lang.ClassNotFoundException: com.liferay.document.library.kernel.model.DLFileEntry cannot be found by com.liferay.portal.search_8.0.0
              at com.liferay.portal.test.rule.LogAssertionAppender.append(LogAssertionAppender.java:60)
              at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)
              at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:66)
              at org.apache.log4j.Category.callAppenders(Category.java:206)
              at org.apache.log4j.Category.forcedLog(Category.java:391)
              at org.apache.log4j.Category.log(Category.java:856)
              at com.liferay.portal.log.Log4jLogImpl.error(Log4jLogImpl.java:54)
              at com.liferay.portal.kernel.log.LogWrapper.error(LogWrapper.java:69)
              at com.liferay.portal.kernel.log.SanitizerLogWrapper.error(SanitizerLogWrapper.java:114)
              at com.liferay.portal.search.internal.searcher.SearchRequestImpl.lambda$setModelIndexerClassNames$1(SearchRequestImpl.java:420)
              at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
              at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
              at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
              at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
              at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:550)
              at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
              at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:517)
              at com.liferay.portal.search.internal.searcher.SearchRequestImpl.setModelIndexerClassNames(SearchRequestImpl.java:425)
              at com.liferay.portal.search.internal.legacy.searcher.SearchRequestBuilderImpl.lambda$modelIndexerClassNames$30(SearchRequestBuilderImpl.java:392)
              at com.liferay.portal.search.internal.legacy.searcher.SearchRequestBuilderImpl.withSearchRequestImpl(SearchRequestBuilderImpl.java:598)
              at com.liferay.portal.search.internal.legacy.searcher.SearchRequestBuilderImpl.modelIndexerClassNames(SearchRequestBuilderImpl.java:391)
              at com.liferay.portal.search.searcher.test.SearchRequestBuilderTest.testModelIndexerClassNames(SearchRequestBuilderTest.java:251)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$3.evaluate(TestExecutorRunnable.java:353)
              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
              at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$2.evaluate(AbstractTestRule.java:99)
              at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
              at org.junit.rules.RunRules.evaluate(RunRules.java:20)
              at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable$1.evaluate(TestExecutorRunnable.java:237)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
              at com.liferay.portal.kernel.test.rule.AbstractTestRule$1.evaluate(AbstractTestRule.java:59)
              at org.junit.rules.RunRules.evaluate(RunRules.java:20)
              at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable._execute(TestExecutorRunnable.java:316)
              at com.liferay.arquillian.extension.junit.bridge.server.TestExecutorRunnable.run(TestExecutorRunnable.java:95)
              at java.base/java.lang.Thread.run(Thread.java:834)
          Caused by: java.lang.ClassNotFoundException: com.liferay.document.library.kernel.model.DLFileEntry cannot be found by com.liferay.portal.search_8.0.0
              at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
              at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
              at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
              at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:151)
              at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
              at java.base/java.lang.Class.forName0(Native Method)
              at java.base/java.lang.Class.forName(Class.java:315)
              at com.liferay.portal.search.internal.searcher.SearchRequestImpl.lambda$setModelIndexerClassNames$1(SearchRequestImpl.java:417)
              ... 43 more
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              adam.brandizzi Adam Brandizzi
              Reporter:
              adam.brandizzi Adam Brandizzi
              Engineering Assignee:
              Adam Brandizzi
              Recent user:
              Sophia Zhang
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Development End Date:
                Development Start Date:

                  Packages

                  Version Package
                  7.3.6 CE GA7
                  7.3.X
                  7.4.13 DXP GA1
                  Master