[ https://issues.apache.org/jira/browse/KARAF-6210?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17678603#comment-17678603 ]
Amichai Rothman commented on KARAF-6210: ---------------------------------------- Having another look at this, I put a breakpoint in CommandExtension.start() where it catches ClassNotFoundException. Indeed, debugger kicked in for bundle org.apache.karaf.bundle.core_4.4.3 [290]. It finds the karaf commands header, finds the clauses, finds all the command class names from the wiring, but bundle.loadClass(className) throws this exception - java.lang.NoClassDefFoundError: org/apache/karaf/shell/api/action/Action. >From looking at the bundle, it seems the org.apache.karaf.shell.* packages are >all resolution:=optional. Maybe it just doesn't have it wired yet (or at all) >due to a startup sequence race? Maybe the shell bundle starts processing other bundles (via bundle listener) which contain commands, before they've had a chance to refresh and see the shell bundle and find its core classes, on which the command classes depend/extend? I don't know when/how/where bundles get refreshed or rewired, but is there any other info that I can get from the debugger that will help you understand this state so we can finally fix it? > 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)