Hi,
org.apache.felix.service.command is not provided by Karaf console (only
org.apache.felix.gogo.*).
The org.apache.felix.service.command is provided by
org.apache.felix.gogo.runtime (also imported in the Karaf console as a
private package).
Regards
JB
On 09/17/2012 07:48 PM, redfish wrote:
Hi,
I'm having the same issue as you but I've not been able to resolve by adding
org.apache.felix.service.command to my package import.
I'm using equinox in Karaf 2.2.9 and trying to follow the example for
extending the console. I'm using eclipse without maven. So, i'm having to
put this together based on what I think it needs to be.
So, I got to the same spot as you. I loaded the bundle with the example
command and got command not found when I tried to execute it. I added the
org.apache.felix.service.command to my package import but now the bundle
won't load.
The bundle fails to load with the following error:
org.osgi.framework.BundleException: The bundle
"org.emory.adapter.karaf.console_1.0.0.201209171331 [56]" could not be
resolved. Reason: Missing Constraint: Import-Package:
org.apache.felix.service.com
mand; version="0.0.0" at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)[osgi-3.6.2.R36x_v20110210.jar:]
.....
What am I missing, I thought this package was provided by the karaf console
bundle (I must be wrong). Is there another dependency that needs to be
loaded. Or am I goofing something else up?
Here are some details:
My Manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: org.emory.adapter.karaf.console
Bundle-SymbolicName: org.emory.adapter.karaf.console
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Blueprint: OSGI-INF/blueprint/*.xml
Import-Package: org.apache.felix.gogo.commands,
org.apache.felix.service.command,
org.apache.karaf.shell.console,
org.osgi.framework
My Class:
package org.emory.adapter.karaf.console;
import org.apache.felix.gogo.commands.Command;
import org.apache.karaf.shell.console.OsgiCommandSupport;
@Command(scope = "test", name = "hello", description="Says hello")
public class HelloShellCommand extends OsgiCommandSupport {
@Override
protected Object doExecute() throws Exception {
System.out.println("Executing Hello command");
return null;
}
}
My Blueprint:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
<command name="test/hello">
<action
class="org.apache.karaf.shell.samples.HelloShellCommand"/>
</command>
</command-bundle>
</blueprint>
Karaf Version 2.2.9 on Windows7 with sun 6.1 jre.
Let me know if any questions or if there is any doc that can assist.
This is my last hurdle to getting my codebase up and running with Karaf.
Thank you so much.
--
View this message in context:
http://karaf.922171.n3.nabble.com/Command-not-found-when-using-Equinox-tp2939669p4026053.html
Sent from the Karaf - User mailing list archive at Nabble.com.
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com