You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by redfish <ke...@gmail.com> on 2012/09/17 19:48:26 UTC
Re: 'Command not found' when using Equinox
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.
Re: 'Command not found' when using Equinox
Posted by Ioannis Canellos <io...@gmail.com>.
I've encountered this issue in many projects I've worked on.
The last I can remember was jclouds-karaf and here's the commit that fixed
the issue:
https://github.com/jclouds/jclouds-karaf/commit/cb799c29cf268fe7a2ba121d74be5123fe25387c
--
*Ioannis Canellos*
*
**
Blog: http://iocanel.blogspot.com
**
Twitter: iocanel
*
Re: 'Command not found' when using Equinox
Posted by redfish <ke...@gmail.com>.
Ok, When I remove the version:
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
I get the same error:
2012-09-18 12:38:12,689 | WARN | -C:\Karaf/deploy | fileinstall
| 6 - org.apache.felix.fileinstall - 3.2.4 | Error while starting bundle:
file:/C:/Karaf/deploy/org.emory.adapter.
karaf.console_1.0.0.201209181237.jar
org.osgi.framework.BundleException: The bundle
"org.emory.adapter.karaf.console_1.0.0.201209181237 [102]" could not be
resolved. Reason: Missing Constraint: Import-Package:
org.apache.felix.service.co
mmand; version="0.0.0" at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)[osgi-3.6.2.R36x_v20110210.jar:]
Any ideas?
--
View this message in context: http://karaf.922171.n3.nabble.com/Command-not-found-when-using-Equinox-tp2939669p4026075.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: 'Command not found' when using Equinox
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
No Maven is not a requirement.
Could you try to avoid the version on the package ?
Regards
JB
On 09/18/2012 05:01 PM, redfish wrote:
> I appreciate the help.
>
> I hope that maven isn't a requirement. I thought I could set this up with
> out maven as long as I get the manifest and the dependencies sorted out
> correctly.
>
> 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;version="0.10.0",
> org.apache.karaf.shell.console,
> org.osgi.framework
>
> Any ideas?
>
> Maybe if I could see a working example, ie: a built bundle that extends the
> console. I could inspect it to see what i'm doing wrong and/or I could load
> it in my karaf and see if it works as expected.
>
> Thanks!
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Command-not-found-when-using-Equinox-tp2939669p4026069.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: 'Command not found' when using Equinox
Posted by redfish <ke...@gmail.com>.
I appreciate the help.
I hope that maven isn't a requirement. I thought I could set this up with
out maven as long as I get the manifest and the dependencies sorted out
correctly.
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;version="0.10.0",
org.apache.karaf.shell.console,
org.osgi.framework
Any ideas?
Maybe if I could see a working example, ie: a built bundle that extends the
console. I could inspect it to see what i'm doing wrong and/or I could load
it in my karaf and see if it works as expected.
Thanks!
--
View this message in context: http://karaf.922171.n3.nabble.com/Command-not-found-when-using-Equinox-tp2939669p4026069.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: 'Command not found' when using Equinox
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
In your bundle, did you define the import package ?
For instance, you should have something like:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Import-Package>
org.apache.felix.service.command,
org.apache.felix.gogo.commands,
org.apache.karaf.shell.console,
*
</Import-Package>
<Private-Package>!*</Private-Package>
</instructions>
</configuration>
</plugin>
in your bundle POM.
As org.apache.felix.service.command is not explicitly used in the code,
maven-bundle-plugin/bnd doesn't import it automatically. That's why you
have to add the statement the maven bundle config.
Regards
JB
On 09/18/2012 04:07 PM, redfish wrote:
> I loaded the Apache Felix Gogo Runtime (0.10.0) by droping
> org.apache.felix.gogo.runtime-0.10.0.jar into my deploy folder. It loaded
> and started. shows active when listed from osgi:list
>
> I redeploy my bundle and get the same resolution issue:
> 2012-09-18 10:01:14,507 | WARN | -C:\Karaf/deploy | fileinstall
> | 6 - org.apache.felix.fileinstall - 3.2.4 | Error while starting bundle:
> file:/C:/Karaf/deploy/org.emory.adapter.
> karaf.console_1.0.0.201209181000.jar
> org.osgi.framework.BundleException: The bundle
> "org.emory.adapter.karaf.console_1.0.0.201209181000 [101]" could not be
> resolved. Reason: Missing Constraint: Import-Package:
> org.apache.felix.service.co
> mmand; version="0.10.0" at
> org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)[osgi-3.6.2.R36x_v20110210.jar:]
> .....
>
> Any ideas what I'm doing wrong?
> Is there an example that is already built that I can look?
> It seems like there are some basics that I'm just not understanding.
>
> Many thanks.
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Command-not-found-when-using-Equinox-tp2939669p4026067.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: 'Command not found' when using Equinox
Posted by redfish <ke...@gmail.com>.
I loaded the Apache Felix Gogo Runtime (0.10.0) by droping
org.apache.felix.gogo.runtime-0.10.0.jar into my deploy folder. It loaded
and started. shows active when listed from osgi:list
I redeploy my bundle and get the same resolution issue:
2012-09-18 10:01:14,507 | WARN | -C:\Karaf/deploy | fileinstall
| 6 - org.apache.felix.fileinstall - 3.2.4 | Error while starting bundle:
file:/C:/Karaf/deploy/org.emory.adapter.
karaf.console_1.0.0.201209181000.jar
org.osgi.framework.BundleException: The bundle
"org.emory.adapter.karaf.console_1.0.0.201209181000 [101]" could not be
resolved. Reason: Missing Constraint: Import-Package:
org.apache.felix.service.co
mmand; version="0.10.0" at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)[osgi-3.6.2.R36x_v20110210.jar:]
.....
Any ideas what I'm doing wrong?
Is there an example that is already built that I can look?
It seems like there are some basics that I'm just not understanding.
Many thanks.
--
View this message in context: http://karaf.922171.n3.nabble.com/Command-not-found-when-using-Equinox-tp2939669p4026067.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: 'Command not found' when using Equinox
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com