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

Different versions of org.osgi.service.log are exported

Description

    After LPS-95455 we're exporting org.osgi.service.log via different modules:

    • org.eclipse.osgi, exporting version 1.3
    • org.apache.felix.log, exporting version 1.4

     

    This can cause ClassCastException like the following one:

    java.lang.ClassCastException: org.apache.felix.log.LogServiceImpl cannot be cast to org.osgi.service.log.LogService
    at org.apache.felix.scr.impl.BundleComponentActivator.log(BundleComponentActivator.java:789)
    at org.apache.felix.scr.impl.BundleComponentActivator.log(BundleComponentActivator.java:755)
    at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:357)
    at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:403)
    at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54)
    at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:278)
    at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
    at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1)
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
    at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:905)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher$1.run(EquinoxEventPublisher.java:79)
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher$1.run(EquinoxEventPublisher.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:77)
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
    at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
    at org.eclipse.osgi.container.Module.start(Module.java:467)
    at org.eclipse.osgi.framework.util.SecureAction$22.run(SecureAction.java:460)
    at org.eclipse.osgi.framework.util.SecureAction$22.run(SecureAction.java:1)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:458)
    at org.eclipse.osgi.container.ModuleContainer.start(ModuleContainer.java:738)
    at org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:715)
    at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:499)
    at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:445)
    at org.eclipse.osgi.container.ModuleContainer.refresh(ModuleContainer.java:980)
    at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1361)
    at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1263)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

     

    Steps to Reproduce:

    1. Add the following property to start the server: -Dds.loglevel=4
    2. Start the portal.

     

    Expected Results:

    The portal should start without exceptions.

     

    Actual  Results:

    The portal throws at least the following errors during the start up:
     

    !ENTRY org.apache.felix.scr 4 0 2019-08-27 08:36:18.340
    !MESSAGE Error while loading components of bundle com.liferay.portal.search.elasticsearch/123
    !STACK 0
    java.lang.ClassCastException: org.apache.felix.log.LogServiceImpl cannot be cast to org.osgi.service.log.LogService
        at org.apache.felix.scr.impl.BundleComponentActivator.log(BundleComponentActivator.java:789)
        at org.apache.felix.scr.impl.BundleComponentActivator.log(BundleComponentActivator.java:755)
        at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:258)
        at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:401)
        at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54)
        at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:278)
        at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
        at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1)
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
        at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:905)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
        at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
        at org.eclipse.osgi.container.Module.start(Module.java:467)
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:421)
        at com.liferay.portal.bootstrap.ModuleFrameworkImpl._startDynamicBundles(ModuleFrameworkImpl.java:1553)
        at com.liferay.portal.bootstrap.ModuleFrameworkImpl.startFramework(ModuleFrameworkImpl.java:411)
        at com.liferay.portal.module.framework.ModuleFrameworkUtilAdapter.startFramework(ModuleFrameworkUtilAdapter.java:99)
        at com.liferay.portal.spring.context.PortalContextLoaderListener.contextInitialized(PortalContextLoaderListener.java:266)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4900)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5363)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:755)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:731)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:620)
        at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1832)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:748)
    
    !ENTRY org.apache.felix.scr 4 0 2019-08-27 08:36:18.576
    !MESSAGE Error while loading components of bundle com.liferay.websocket.whiteboard/679
    !STACK 0
    java.lang.ClassCastException: org.apache.felix.log.LogServiceImpl cannot be cast to org.osgi.service.log.LogService
        at org.apache.felix.scr.impl.BundleComponentActivator.log(BundleComponentActivator.java:789)
        at org.apache.felix.scr.impl.BundleComponentActivator.log(BundleComponentActivator.java:755)
        at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:258)
        at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:401)
        at org.apache.felix.scr.impl.Activator.access$200(Activator.java:54)
        at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:278)
        at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
        at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
        at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1)
        at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
        at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:905)
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
        at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)
        at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
        at org.eclipse.osgi.container.Module.start(Module.java:467)
        at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1258)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1230)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)
    

     

    Attachments

      Issue Links

        Activity

          People

            summer.zhang Summer Zhang
            mariano.alvaro Mariano Álvaro
            Marta Elicegui Marta Elicegui
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              2 years, 3 weeks, 6 days ago

              Packages

                Version Package
                7.0.0 DXP FP97
                7.0.X
                7.1.10 DXP FP20
                7.1.10.5 SP5
                7.1.X
                7.2.10 DXP FP2
                7.2.10.1 DXP SP1
                7.2.X
                7.3.10 DXP FP1
                7.3.10.1 DXP SP1
                7.3.6 CE GA7
                7.3.X
                7.4.13 DXP GA1
                Master