Uploaded image for project: 'PUBLIC - Liferay Commerce'
  1. PUBLIC - Liferay Commerce
  2. COMMERCE-4016

Commerce headless modules fail at runtime due to SearchUtil$SearchContext

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.1
    • Component/s: None
    • Labels:
      None

      Description

      Commerce headless modules compile and deploy properly, but when portal tries to activate them, an exception like the following is thrown:

      2020-05-29 20:15:52.370 WARN  [Portal Dependency Manager Component Executor--1][ProductHelper:99] bundle com.liferay.headless.commerce.admin.catalog.impl:1.0.39 (1221)[com.liferay.headless.commerce.admin.catalog.internal.helper.v1_0.ProductHelper(3463)] :  Failure loooking up method activate(org.osgi.service.component.ComponentContext) in class class com.liferay.headless.commerce.admin.catalog.internal.helper.v1_0.ProductHelper. Assuming no such method. 
      java.lang.NoClassDefFoundError: com/liferay/portal/vulcan/util/SearchUtil$SearchContext
      	at java.lang.Class.getDeclaredMethods0(Native Method)
      	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      	at java.lang.Class.getDeclaredMethod(Class.java:2128)
      	at org.apache.felix.scr.impl.inject.methods.BaseMethod.getMethod(BaseMethod.java:326)
      	at org.apache.felix.scr.impl.inject.methods.ActivateMethod.doFindMethod(ActivateMethod.java:71)
      	at org.apache.felix.scr.impl.inject.methods.BaseMethod.findMethod(BaseMethod.java:173)
      	at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$400(BaseMethod.java:41)
      	at org.apache.felix.scr.impl.inject.methods.BaseMethod$NotResolved.resolve(BaseMethod.java:602)
      	at org.apache.felix.scr.impl.inject.methods.BaseMethod$NotResolved.methodExists(BaseMethod.java:626)
      	at org.apache.felix.scr.impl.inject.methods.BaseMethod.methodExists(BaseMethod.java:528)
      	at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:315)
      	at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:307)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:341)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:114)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:983)
      	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:956)
      	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:756)
      	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1053)
      	at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(DependencyManager.java:1007)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1216)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1137)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:944)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:880)
      	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1168)
      	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:125)
      	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:891)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:804)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
      	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:228)
      	at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:469)
      	at com.liferay.portal.spring.extender.internal.bean.ApplicationContextServicePublisherUtil._registerService(ApplicationContextServicePublisherUtil.java:165)
      	at com.liferay.portal.spring.extender.internal.bean.ApplicationContextServicePublisherUtil.lambda$registerContext$0(ApplicationContextServicePublisherUtil.java:65)
      	at java.util.Iterator.forEachRemaining(Iterator.java:116)
      	at com.liferay.portal.spring.extender.internal.bean.ApplicationContextServicePublisherUtil.registerContext(ApplicationContextServicePublisherUtil.java:61)
      	at com.liferay.portal.spring.extender.internal.context.ModuleApplicationContextRegistrator.start(ModuleApplicationContextRegistrator.java:101)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.felix.dm.impl.InvocationUtil.invokeMethod(InvocationUtil.java:157)
      	at org.apache.felix.dm.impl.InvocationUtil.invokeCallbackMethod(InvocationUtil.java:112)
      	at org.apache.felix.dm.impl.ComponentImpl.invokeCallbackMethod(ComponentImpl.java:638)
      	at org.apache.felix.dm.impl.ComponentImpl.invoke(ComponentImpl.java:1783)
      	at org.apache.felix.dm.impl.ComponentImpl.invokeStart(ComponentImpl.java:1281)
      	at org.apache.felix.dm.impl.ComponentImpl.performTransition(ComponentImpl.java:1232)
      	at org.apache.felix.dm.impl.ComponentImpl.handleChange(ComponentImpl.java:1166)
      	at org.apache.felix.dm.impl.ComponentImpl.handleAdded(ComponentImpl.java:1337)
      	at org.apache.felix.dm.impl.ComponentImpl.lambda$handleEvent$6(ComponentImpl.java:565)
      	at org.apache.felix.dm.impl.DispatchExecutor.runTask(DispatchExecutor.java:182)
      	at org.apache.felix.dm.impl.DispatchExecutor.run(DispatchExecutor.java:165)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.ClassNotFoundException: com.liferay.portal.vulcan.util.SearchUtil$SearchContext cannot be found by com.liferay.headless.commerce.admin.catalog.impl_1.0.39
      	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:457)
      	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.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 54 more
      

      Steps to reproduce are very simple:

      • Deploy any of headless-commerce-admin-account-impl, headless-commerce-admin-catalog-impl, headless-commerce-admin-inventory-impl, headless-commerce-admin-order-impl, or headless-commerce-admin-pricing-impl
      • (Start up Liferay if it isn't started already)

      Expected:
      Modules start up.

      Observed:
      Modules fail with a NoClassDefFoundError and stacktrace like the one above

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              ethan.bustad Ethan Bustad (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  2.1.1