You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com> on 2015/11/16 18:05:18 UTC

Karaf 4.0.3 - no custom shell commands

Dear Karaf addicts,

I export custom Karaf shell commands using blueprint. It was ok with Karaf 3.0.x, but not working (i.e. no custom command available in the shell) with 4.0.3.

For instance:
Java:

public /*final*/ MySimulator { // No final as GOGO command

public void sayHello() {

  System.out.println("hello");

}

}


XML:

<bean id="mySimulator" class="shell.MySimulator"/>



<service ref="mySimulator" auto-export="class-hierarchy">

<service-properties>

  <entry key="osgi.command.scope" value="simu"/>

  <entry key="osgi.command.function">

   <array>

    <value>sayHello</value>

   </array>

  </entry>

</service-properties>

</service>

How to fix this and allow Karaf to handle my commands?

PS: the assembly does include the following boot features: aries-blueprint, bundle, shell-compat, ssh

Kind regards,
Jean-Philippe

[@@ OPEN @@]


Re: Karaf 4.0.3 - no custom shell commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
shell.MySimulator doesn't implement any Action or Command ?
Don't you use annotations (to define arg/options), and doExecute() command ?

Regards
JB

On 11/16/2015 06:18 PM, CLEMENT Jean-Philippe wrote:
> Hi JB,
>
> The bean does not implement any interface, so I guess from what you said is a "gogo" command.
>
> JP
>
> [@@ OPEN @@]
>
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Envoyé : lundi 16 novembre 2015 18:15
> À : user@karaf.apache.org
> Objet : Re: Karaf 4.0.3 - no custom shell commands
>
> Hi JP,
>
> does your command bean implements
> org.apache.karaf.shell.api.action.Action or is it a gogo command ?
>
> Regards
> JB
>
> On 11/16/2015 06:05 PM, CLEMENT Jean-Philippe wrote:
>> Dear Karaf addicts,
>>
>> I export custom Karaf shell commands using blueprint. It was ok with
>> Karaf 3.0.x, but not working (i.e. no custom command available in the
>> shell) with 4.0.3.
>>
>> For instance:
>>
>> Java:
>>
>> public /*final*/ MySimulator { // No final as GOGO command
>>
>> public void sayHello() {
>>
>> System.out.println("hello");
>>
>> }
>>
>> }
>>
>> XML:
>>
>> <bean id="mySimulator" class="shell.MySimulator"/>
>>
>> <service ref="mySimulator" auto-export="class-hierarchy">
>>
>> <service-properties>
>>
>>     <entry key="osgi.command.scope" value="simu"/>
>>
>>     <entry key="osgi.command.function">
>>
>>      <array>
>>
>>       <value>sayHello</value>
>>
>>      </array>
>>
>> </entry>
>>
>> </service-properties>
>>
>> </service>
>>
>> How to fix this and allow Karaf to handle my commands?
>>
>> PS: the assembly does include the following boot features:
>> aries-blueprint, bundle, shell-compat, ssh
>>
>> Kind regards,
>>
>> Jean-Philippe
>>
>> [@@ OPEN @@]
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.0.3 - no custom shell commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi guys,

the problem is related to this:

https://issues.apache.org/jira/browse/KARAF-4118

I gonna fix that.

Regards
JB

On 11/16/2015 06:18 PM, CLEMENT Jean-Philippe wrote:
> Hi JB,
>
> The bean does not implement any interface, so I guess from what you said is a "gogo" command.
>
> JP
>
> [@@ OPEN @@]
>
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Envoyé : lundi 16 novembre 2015 18:15
> À : user@karaf.apache.org
> Objet : Re: Karaf 4.0.3 - no custom shell commands
>
> Hi JP,
>
> does your command bean implements
> org.apache.karaf.shell.api.action.Action or is it a gogo command ?
>
> Regards
> JB
>
> On 11/16/2015 06:05 PM, CLEMENT Jean-Philippe wrote:
>> Dear Karaf addicts,
>>
>> I export custom Karaf shell commands using blueprint. It was ok with
>> Karaf 3.0.x, but not working (i.e. no custom command available in the
>> shell) with 4.0.3.
>>
>> For instance:
>>
>> Java:
>>
>> public /*final*/ MySimulator { // No final as GOGO command
>>
>> public void sayHello() {
>>
>> System.out.println("hello");
>>
>> }
>>
>> }
>>
>> XML:
>>
>> <bean id="mySimulator" class="shell.MySimulator"/>
>>
>> <service ref="mySimulator" auto-export="class-hierarchy">
>>
>> <service-properties>
>>
>>     <entry key="osgi.command.scope" value="simu"/>
>>
>>     <entry key="osgi.command.function">
>>
>>      <array>
>>
>>       <value>sayHello</value>
>>
>>      </array>
>>
>> </entry>
>>
>> </service-properties>
>>
>> </service>
>>
>> How to fix this and allow Karaf to handle my commands?
>>
>> PS: the assembly does include the following boot features:
>> aries-blueprint, bundle, shell-compat, ssh
>>
>> Kind regards,
>>
>> Jean-Philippe
>>
>> [@@ OPEN @@]
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.0.3 - no custom shell commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
OK, so, you just declare the command using blueprint and service properties.

Let me try a sample (both in Karaf 3 & 4), I suspect the interface found 
by blueprint.

Regards
JB

On 11/16/2015 06:18 PM, CLEMENT Jean-Philippe wrote:
> Hi JB,
>
> The bean does not implement any interface, so I guess from what you said is a "gogo" command.
>
> JP
>
> [@@ OPEN @@]
>
>
> -----Message d'origine-----
> De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Envoyé : lundi 16 novembre 2015 18:15
> À : user@karaf.apache.org
> Objet : Re: Karaf 4.0.3 - no custom shell commands
>
> Hi JP,
>
> does your command bean implements
> org.apache.karaf.shell.api.action.Action or is it a gogo command ?
>
> Regards
> JB
>
> On 11/16/2015 06:05 PM, CLEMENT Jean-Philippe wrote:
>> Dear Karaf addicts,
>>
>> I export custom Karaf shell commands using blueprint. It was ok with
>> Karaf 3.0.x, but not working (i.e. no custom command available in the
>> shell) with 4.0.3.
>>
>> For instance:
>>
>> Java:
>>
>> public /*final*/ MySimulator { // No final as GOGO command
>>
>> public void sayHello() {
>>
>> System.out.println("hello");
>>
>> }
>>
>> }
>>
>> XML:
>>
>> <bean id="mySimulator" class="shell.MySimulator"/>
>>
>> <service ref="mySimulator" auto-export="class-hierarchy">
>>
>> <service-properties>
>>
>>     <entry key="osgi.command.scope" value="simu"/>
>>
>>     <entry key="osgi.command.function">
>>
>>      <array>
>>
>>       <value>sayHello</value>
>>
>>      </array>
>>
>> </entry>
>>
>> </service-properties>
>>
>> </service>
>>
>> How to fix this and allow Karaf to handle my commands?
>>
>> PS: the assembly does include the following boot features:
>> aries-blueprint, bundle, shell-compat, ssh
>>
>> Kind regards,
>>
>> Jean-Philippe
>>
>> [@@ OPEN @@]
>>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

RE: Karaf 4.0.3 - no custom shell commands

Posted by CLEMENT Jean-Philippe <je...@fr.thalesgroup.com>.
Hi JB,

The bean does not implement any interface, so I guess from what you said is a "gogo" command.

JP

[@@ OPEN @@]


-----Message d'origine-----
De : Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Envoyé : lundi 16 novembre 2015 18:15
À : user@karaf.apache.org
Objet : Re: Karaf 4.0.3 - no custom shell commands

Hi JP,

does your command bean implements
org.apache.karaf.shell.api.action.Action or is it a gogo command ?

Regards
JB

On 11/16/2015 06:05 PM, CLEMENT Jean-Philippe wrote:
> Dear Karaf addicts,
>
> I export custom Karaf shell commands using blueprint. It was ok with 
> Karaf 3.0.x, but not working (i.e. no custom command available in the
> shell) with 4.0.3.
>
> For instance:
>
> Java:
>
> public /*final*/ MySimulator { // No final as GOGO command
>
> public void sayHello() {
>
> System.out.println("hello");
>
> }
>
> }
>
> XML:
>
> <bean id="mySimulator" class="shell.MySimulator"/>
>
> <service ref="mySimulator" auto-export="class-hierarchy">
>
> <service-properties>
>
>    <entry key="osgi.command.scope" value="simu"/>
>
>    <entry key="osgi.command.function">
>
>     <array>
>
>      <value>sayHello</value>
>
>     </array>
>
> </entry>
>
> </service-properties>
>
> </service>
>
> How to fix this and allow Karaf to handle my commands?
>
> PS: the assembly does include the following boot features:
> aries-blueprint, bundle, shell-compat, ssh
>
> Kind regards,
>
> Jean-Philippe
>
> [@@ OPEN @@]
>

--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.0.3 - no custom shell commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi JP,

does your command bean implements 
org.apache.karaf.shell.api.action.Action or is it a gogo command ?

Regards
JB

On 11/16/2015 06:05 PM, CLEMENT Jean-Philippe wrote:
> Dear Karaf addicts,
>
> I export custom Karaf shell commands using blueprint. It was ok with
> Karaf 3.0.x, but not working (i.e. no custom command available in the
> shell) with 4.0.3.
>
> For instance:
>
> Java:
>
> public /*final*/ MySimulator { // No final as GOGO command
>
> public void sayHello() {
>
> System.out.println("hello");
>
> }
>
> }
>
> XML:
>
> <bean id="mySimulator" class="shell.MySimulator"/>
>
> <service ref="mySimulator" auto-export="class-hierarchy">
>
> <service-properties>
>
>    <entry key="osgi.command.scope" value="simu"/>
>
>    <entry key="osgi.command.function">
>
>     <array>
>
>      <value>sayHello</value>
>
>     </array>
>
> </entry>
>
> </service-properties>
>
> </service>
>
> How to fix this and allow Karaf to handle my commands?
>
> PS: the assembly does include the following boot features:
> aries-blueprint, bundle, shell-compat, ssh
>
> Kind regards,
>
> Jean-Philippe
>
> [@@ OPEN @@]
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 4.0.3 - no custom shell commands

Posted by Daniel McGreal <d....@gmail.com>.
Hi Jean-Phillippe,
Just to say, I also couldn’t get it to work some while back.
Here’s my post, in case it contains anything useful: http://karaf.922171.n3.nabble.com/iPOJO-on-K4-td4042340.html
Dan.

> On 16 Nov 2015, at 17:05, CLEMENT Jean-Philippe <je...@fr.thalesgroup.com> wrote:
> 
> Dear Karaf addicts,
>  
> I export custom Karaf shell commands using blueprint. It was ok with Karaf 3.0.x, but not working (i.e. no custom command available in the shell) with 4.0.3.
>  
> For instance:
> Java:
> public /*final*/ MySimulator { // No final as GOGO command
> public void sayHello() {
>   System.out.println("hello");
> }
> }
>  
> XML:
> <bean id="mySimulator" class="shell.MySimulator"/>
>  
> <service ref="mySimulator" auto-export="class-hierarchy">
> <service-properties>
>   <entry key="osgi.command.scope" value="simu"/>
>   <entry key="osgi.command.function">
>    <array>
>     <value>sayHello</value>
>    </array>
>   </entry>
> </service-properties>
> </service>
>  
> How to fix this and allow Karaf to handle my commands?
>  
> PS: the assembly does include the following boot features: aries-blueprint, bundle, shell-compat, ssh
>  
> Kind regards,
> Jean-Philippe
>  
> [@@ OPEN @@]