[ https://issues.apache.org/jira/browse/KARAF-6210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679216#comment-17679216 ]
Amichai Rothman edited comment on KARAF-6210 at 1/20/23 4:08 PM: ----------------------------------------------------------------- I'm not sure what you mean... I recreated again with a breakpoint in the same place, this time the org.apache.karaf.kar.core bundle hit the exception first. In the debugger if I look at the lower stack frames (the ones around FeaturesServiceImpl) and poke around at the parameters and local variables, it seems like it's processing everything - e.g. a 'requirements' field in a DeploymentRequest object has an entry 'root' and 39 features under it, which I think is everything. In the loop that starts the bundles, the toStart collection has 300 bundles in it, which again, I think is everything that's installed. So I'm not sure if it's a refresh, or just startup... what specifically should I be looking for? btw in 4.4.3 the exact stacktrace is: java.lang.NoClassDefFoundError: org/apache/karaf/shell/api/action/Action at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:283) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:716) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:639) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:607) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:587) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:566) at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:335) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:397) at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:500) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:622) at org.apache.karaf.shell.impl.action.osgi.CommandExtension.start(CommandExtension.java:100) at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254) at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:488) at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:420) at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:949) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:229) at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:138) at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:130) at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:217) at org.eclipse.osgi.container.Module.publishEvent(Module.java:499) at org.eclipse.osgi.container.Module.start(Module.java:486) at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:464) at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:165) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1160) at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1041) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.ClassNotFoundException: org.apache.karaf.shell.api.action.Action cannot be found by org.apache.karaf.kar.core_4.4.3 at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:541) at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:536) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 42 more was (Author: amichai): I'm not sure what you mean... I recreated again with a breakpoint in the same place, this time the org.apache.karaf.kar.core bundle hit the exception first. In the debugger if I look at the lower stack frames (the ones around FeaturesServiceImpl) and poke around at the parameters and local variables, it seems like it's processing everything - e.g. a 'requirements' field in a DeploymentRequest object has an entry 'root' and 39 features under it, which I think is everything. In the loop that starts the bundles, the toStart collection has 300 bundles in it, which again, I think is everything that's installed. So I'm not sure if it's a refresh, or just startup... what specifically should I be looking for? btw in 4.3.4 the exact stacktrace is: java.lang.NoClassDefFoundError: org/apache/karaf/shell/api/action/Action at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:283) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:716) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:639) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:607) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:587) at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:566) at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:335) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:397) at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:500) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:622) at org.apache.karaf.shell.impl.action.osgi.CommandExtension.start(CommandExtension.java:100) at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:254) at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:227) at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:488) at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:420) at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232) at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450) at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:949) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151) at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:229) at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:138) at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:130) at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:217) at org.eclipse.osgi.container.Module.publishEvent(Module.java:499) at org.eclipse.osgi.container.Module.start(Module.java:486) at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:464) at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:165) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1160) at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1041) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.ClassNotFoundException: org.apache.karaf.shell.api.action.Action cannot be found by org.apache.karaf.kar.core_4.4.3 at org.eclipse.osgi.internal.loader.BundleLoader.generateException(BundleLoader.java:541) at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:536) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:416) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:168) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522) ... 42 more > NoClassDefFoundError: org/apache/karaf/shell/api/action/Action when starting > Karaf > ---------------------------------------------------------------------------------- > > Key: KARAF-6210 > URL: https://issues.apache.org/jira/browse/KARAF-6210 > Project: Karaf > Issue Type: Bug > Components: karaf > Affects Versions: 4.2.4, 4.3.2 > Environment: Stock Karaf 4.2.4 on Windows 10 with latest Oracle JDK 8. > Reporter: Amichai Rothman > Assignee: Jean-Baptiste Onofré > Priority: Major > Attachments: karaf_command_not_found.log > > > When starting karaf using equinox and some bundle in the deploy folder, many > shell commands (such as bundle:* and others) are not recognized, and the log > shows NoClassDefFoundError: org/apache/karaf/shell/api/action/Action. Some > commands don't work, but others (e.g. shell:*) do. > This happens consistently on Windows 10, but not on Linux, not sure why. > > Steps to recreate: > 1. Extract stock Karaf 4.2.4. > 2. In etc/config.properties change karaf.framework=felix to > karaf.framework=equinox. > 3. Place org.apache.aries.transaction.blueprint-2.2.0.jar (from maven) in > deploy folder. This is not the only bundle it happens with, just a public one > I found for this example. From several I tried, some recreated the issue and > some did not. The bundle is not resolved due to missing dependencies. > 4. Start Karaf. > 5. Try to run bundle:list and it'll say command not found. Or look at the > karaf log and see "java.lang.NoClassDefFoundError: > org/apache/karaf/shell/api/action/Action". Use shell completion to see that > some commands are available but others are not. > -- This message was sent by Atlassian Jira (v8.20.10#820010)