[ODLPARENT-228] SFT contains errors around OsgiLocator Created: 04/Mar/20  Updated: 15/Jun/20  Resolved: 15/Jun/20

Status: Resolved
Project: odlparent
Component/s: SFT
Affects Version/s: None
Fix Version/s: 5.0.8, 6.0.8, 7.0.4

Type: Bug Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The following seems to appear in SFT:

2020-03-04T14:18:43,720 | ERROR | Framework Event Dispatcher: org.eclipse.osgi.internal.framework.EquinoxEventPublisher@5efa40fe | FrameworkEvent                   | 0 - org.eclipse.osgi - 3.12.100.v20180210-1608 | FrameworkEvent ERROR
java.lang.NoClassDefFoundError: org/apache/karaf/specs/locator/OsgiLocator
        at org.apache.karaf.specs.activator.Activator.register(Activator.java:124) ~[org.apache.karaf.specs.activator-4.2.8.jar:4.2.8]
        at org.apache.karaf.specs.activator.Activator.bundleChanged(Activator.java:96) ~[org.apache.karaf.specs.activator-4.2.8.jar:4.2.8]
        at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908) ~[?:?]
        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:213) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) ~[?:?]
        at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:719) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:511) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:457) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:447) ~[?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerWiring.resolveBundles(ModuleContainer.java:1313) ~[?:?]
        at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.resolveBundles(BundleInstallSupportImpl.java:244) ~[?:?]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.resolveBundles(FeaturesServiceImpl.java:1168) ~[?:?]
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1022) ~[?:?]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) ~[?:?]
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
        at java.lang.Thread.run(Thread.java:834) ~[?:?]


 Comments   
Comment by Robert Varga [ 06/Mar/20 ]

This probably has to do with the fact that the spec implementation resides in endorsed/ and the activator is in boot/.

Comment by Robert Varga [ 12/Jun/20 ]

Actually this is a mismatch in versions, as we end up patching modules like this:

--patch-module java.base=lib/endorsed/org.apache.karaf.specs.locator-7.0.4-SNAPSHOT.jar

this version should point to karaf version, not to the distribution version:

nite@nitebug : ~/odl/odlparent/features/odl-apache-commons-codec on  $ find . -name org.apache.karaf.specs.locator\*.jar
./target/pax/93e8a08b-677f-40ce-b454-75f6deea9972/lib/endorsed/org.apache.karaf.specs.locator-4.2.8.jar
Comment by Robert Varga [ 12/Jun/20 ]

Updating to TCP sockets reveals the following output:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/nite/.m2/repository/org/apache/karaf/org.apache.karaf.client/4.2.8/org.apache.karaf.client-4.2.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/nite/.m2/repository/org/ops4j/pax/logging/pax-logging-api/1.11.4/pax-logging-api-1.11.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/nite/.m2/repository/org/slf4j/slf4j-simple/1.7.28/slf4j-simple-1.7.28.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
[sys.out] About to run test: org.opendaylight.odlparent.featuretest.SingleFeatureTest[repoUrl: file:/home/nite/odl/odlparent/features/odl-apache-commons-codec/target/feature/feature.xml, Feature: odl-apache-commons-codec 7.0.4.SNAPSHOT]
WARNING: package org.apache.karaf.specs.locator not in java.base
Apache Karaf starting up. Press Enter to open the shell now...
Error starting karaf activator org.apache.karaf.specs.activator.Activator: org/apache/karaf/specs/locator/OsgiLocator

 

Generated at Wed Feb 07 20:27:58 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.