You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by rkmoquin <fr...@gmail.com> on 2013/06/16 04:37:10 UTC

Schema for custom shell commands

If you reference the v1.0.0 schema when creating a shell extension,
everything is fine, for example:

<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0"> 

but if you change it to:

<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0"> 

which is valid, then Karaf (at least in the integration tests for sure),
you'll get a validation error error:

2013-06-15 21:11:15,935 | ERROR | pool-12-thread-1 | BlueprintContainerImpl          
| 28 - org.apache.aries.blueprint.core - 1.1.1.SNAPSHOT | Unable to start
blueprint container for bundle org.apache.karaf.cellar.shell
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
validate xml
        at
org.apache.aries.blueprint.parser.Parser.validate(Parser.java:288)
        at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:313)[28:org.apache.aries.blueprint.core:1.1.1.SNAPSHOT]
.......
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute
'name' is not allowed to appear
 in element 'command'.
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)[:1.7.0_17]
-----------------------------------------------------------------------

Now, if you keep the namespace at v1.1.0 and remove the name attribute from
each of the commands, you end up with a different more cryptic error that
you won't get with v1.0.0, for example:

2013-06-15 22:33:54,037 | ERROR | pool-12-thread-1 | BlueprintContainerImpl          
| 28 - org.apache.aries.blueprint.core - 1.1.1.SNAPSHOT | Unable to start
blueprint container for bundle org.apache.karaf.cellar.shell
org.osgi.service.blueprint.container.ComponentDefinitionException:
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
find a matching factory method getScope on class
org.apache.karaf.shell.console.commands.NamespaceHandler for arguments
[org.apache.karaf.cellar.shell.producer.ProducerStopCommand] when
instanciating bean #recipe-224

Is this a bug?  If so, I'll file a Jira, it's just weird.

Ryan



--
View this message in context: http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4029047.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Schema for custom shell commands

Posted by asookazian2 <as...@gmail.com>.
I checked the MANIFEST.MF in the other class's jar and noticed that in the
Import-Package section I was missing the following in the pom.xml for my
project:

,org.apache.karaf.shell.commands;resolution:=optional;version="[3.0,4)"
,org.apache.karaf.shell.console;resolution:=optional;version="[3.0,4)"

After adding this to the pom.xml for the maven-bundle-plugin section,
rebuilding and re-installing, the exception is not reproducing.



--
View this message in context: http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4029047p4035582.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Schema for custom shell commands

Posted by asookazian2 <as...@gmail.com>.
I am running into the same problem with Karaf 3.0.1.

Caused by:
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
find a matching factory method getScope on class
org.apache.karaf.shell.console.commands.NamespaceHandler for arguments
[com.nextgate.accessmanager.user.setup.ProvisionUserCommand] when
instanciating bean #recipe-25
	at
org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:318)
	at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)
	at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
	at
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:106)
	at
org.apache.aries.blueprint.di.MapRecipe.internalCreate(MapRecipe.java:111)

I am getting this exception with v1.1.0 and v1.0.0.  Please advise as I
cannot continue testing at this point.

This is my blueprint.xml:

<?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.1.0">
        <command>
            <action
class="com.nextgate.accessmanager.user.setup.ProvisionUserCommand"/>
        </command>
    </command-bundle>
</blueprint>

Interestingly, a different class which extends OsgiCommandSupport with a
different blueprint.xml in the same Karaf instance is NOT having this
problem (it's using v1.1.0).  I'm not sure what the difference is, the
blueprint.xml files are very similar.



--
View this message in context: http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4029047p4035579.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Schema for custom shell commands

Posted by Marco Westermann <mw...@intersales.de>.
Hi,

forget about my above answer. Did not read the complete conversation 
properly.

regards, Marco

Am 22.01.2014 10:15, schrieb Marco Westermann:
> Hi,
>
> you are missing the name attribute on the command tag like in this 
> example:
>
> |<command*name="test/hello"*>
>        <action class="org.apache.karaf.shell.samples.HelloShellCommand"/>
> </command>
>
> |
>
> regards, Marco
>
> Am 22.01.2014 09:48, schrieb Roedl Lukas:
>> Hi JB,
>>
>> I've tested it once again and I still get an error when deploying a command with version 1.1.0 in Karaf 2.3.3:
>>
>> [ERROR] BlueprintContainerImpl - Unable to start blueprint container for bundle at.ac.ait.hbs.homer.core.shell.scheduler
>> org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml
>>          at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:288)
>>          at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:313)
>>          at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
>>          at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:259)
>>          at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:222)
>>          ...
>>          at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
>> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.4: Attribute 'name' must appear on element 'command'.
>>          at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[:]
>>          ...
>>          ... 29 more
>>
>> My command looks like this:
>>
>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>>          xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
>>              http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>>      <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0"  xsi:schemaLocation="http://karaf.apache.org/xmlns/shell/v1.1.0 http://karaf.apache.org/xmlns/shell/v1.1.0">
>>          <command>
>>              <action class="at.ac.ait.hbs.homer.core.shell.scheduler.commands.SchedulerList">
>>              </action>
>>          </command>
>>      </command-bundle>
>> </blueprint>
>>
>> Best regards,
>>
>> Lukas
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
>> Gesendet: Mittwoch, 22. Januar 2014 07:30
>> An:user@karaf.apache.org
>> Betreff: Re: AW: Schema for custom shell commands
>>
>> Hi Vinu,
>>
>> I checked and if you use shell namespace 1.1.0, you have to NOT use the name attribute on the command element (the name is now taken from the command class).
>> The name attribute is required only if you use shell namespace 1.0.0.
>>
>> However, namespace 1.0.0 is still supported in Karaf 3.0.0.
>>
>> Regards
>> JB
>>
>> On 01/22/2014 07:26 AM, Vinu Raj wrote:
>>> Any further updates on this issue. I am using karaf 3.0.0 and facing
>>> the same issue. With namespace v1.1.0 and command element with about
>>> name attribute, getting following error.
>>>
>>> Caused by:
>>> org.osgi.service.blueprint.container.ComponentDefinitionException:
>>> Unable to find a matching factory method getScope on class
>>> org.apache.karaf.shell.console.commands.NamespaceHandler for arguments
>>> [com.test.cmd.list] when instanciating bean #recipe-7
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4
>>> 029047p4031242.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
>
>
> -- 
> ++ Business-Software aus einer Hand ++
> ++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
> http://www.intersales.de
> http://www.eisxen.org
> http://www.tarantella-partner.de
> http://www.medisales.de
> http://www.eisfair.net
>
> interSales AG Internet Commerce
> Weinsbergstr. 190
> 50825 Köln
>
> Tel  02 21 - 27 90 50
> Fax  02 21 - 27 90 517
> Mailisinfo@intersales.de
> Mailmw@intersales.de
> Webwww.intersales.de
>
> Handelsregister Köln HR B 30904
> Ust.-Id.: DE199672015
> Finanzamt Köln-Nord. UstID: nicht vergeben
> Aufsichtsratsvorsitzender: Michael Hippler
> Vorstand: Andrej Radonic, Peter Zander


-- 
++ Business-Software aus einer Hand ++
++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
http://www.intersales.de
http://www.eisxen.org
http://www.tarantella-partner.de
http://www.medisales.de
http://www.eisfair.net

interSales AG Internet Commerce
Weinsbergstr. 190
50825 Köln

Tel  02 21 - 27 90 50
Fax  02 21 - 27 90 517
Mail isinfo@intersales.de
Mail mw@intersales.de
Web  www.intersales.de

Handelsregister Köln HR B 30904
Ust.-Id.: DE199672015
Finanzamt Köln-Nord. UstID: nicht vergeben
Aufsichtsratsvorsitzender: Michael Hippler
Vorstand: Andrej Radonic, Peter Zander


Re: Schema for custom shell commands

Posted by Marco Westermann <mw...@intersales.de>.
Hi,

you are missing the name attribute on the command tag like in this example:

|<command*name="test/hello"*>
       <action class="org.apache.karaf.shell.samples.HelloShellCommand"/>
</command>

|


regards, Marco

Am 22.01.2014 09:48, schrieb Roedl Lukas:
> Hi JB,
>
> I've tested it once again and I still get an error when deploying a command with version 1.1.0 in Karaf 2.3.3:
>
> [ERROR] BlueprintContainerImpl - Unable to start blueprint container for bundle at.ac.ait.hbs.homer.core.shell.scheduler
> org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml
>          at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:288)
>          at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:313)
>          at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
>          at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:259)
>          at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:222)
>          ...
>          at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.4: Attribute 'name' must appear on element 'command'.
>          at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[:]
>          ...
>          ... 29 more
>
> My command looks like this:
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>          xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
>              http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>      <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0" xsi:schemaLocation="http://karaf.apache.org/xmlns/shell/v1.1.0 http://karaf.apache.org/xmlns/shell/v1.1.0">
>          <command>
>              <action class="at.ac.ait.hbs.homer.core.shell.scheduler.commands.SchedulerList">
>              </action>
>          </command>
>      </command-bundle>
> </blueprint>
>
> Best regards,
>
> Lukas
>
> -----Ursprüngliche Nachricht-----
> Von: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Gesendet: Mittwoch, 22. Januar 2014 07:30
> An: user@karaf.apache.org
> Betreff: Re: AW: Schema for custom shell commands
>
> Hi Vinu,
>
> I checked and if you use shell namespace 1.1.0, you have to NOT use the name attribute on the command element (the name is now taken from the command class).
> The name attribute is required only if you use shell namespace 1.0.0.
>
> However, namespace 1.0.0 is still supported in Karaf 3.0.0.
>
> Regards
> JB
>
> On 01/22/2014 07:26 AM, Vinu Raj wrote:
>> Any further updates on this issue. I am using karaf 3.0.0 and facing
>> the same issue. With namespace v1.1.0 and command element with about
>> name attribute, getting following error.
>>
>> Caused by:
>> org.osgi.service.blueprint.container.ComponentDefinitionException:
>> Unable to find a matching factory method getScope on class
>> org.apache.karaf.shell.console.commands.NamespaceHandler for arguments
>> [com.test.cmd.list] when instanciating bean #recipe-7
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4
>> 029047p4031242.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


-- 
++ Business-Software aus einer Hand ++
++ Internet, Warenwirtschaft, Linux, Virtualisierung ++
http://www.intersales.de
http://www.eisxen.org
http://www.tarantella-partner.de
http://www.medisales.de
http://www.eisfair.net

interSales AG Internet Commerce
Weinsbergstr. 190
50825 Köln

Tel  02 21 - 27 90 50
Fax  02 21 - 27 90 517
Mail isinfo@intersales.de
Mail mw@intersales.de
Web  www.intersales.de

Handelsregister Köln HR B 30904
Ust.-Id.: DE199672015
Finanzamt Köln-Nord. UstID: nicht vergeben
Aufsichtsratsvorsitzender: Michael Hippler
Vorstand: Andrej Radonic, Peter Zander


AW: AW: AW: Schema for custom shell commands

Posted by Roedl Lukas <Lu...@ait.ac.at>.
Ok, then the error message makes sense.
Thanks for your clarification - I didn't know that 1.1.0 wasn't supported at the 2.3.x branch ;-)

Best regards,
Lukas

-----Ursprüngliche Nachricht-----
Von: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Gesendet: Mittwoch, 22. Januar 2014 10:51
An: user@karaf.apache.org
Betreff: Re: AW: AW: Schema for custom shell commands

shell namespace 1.1.0 is only available with Karaf 3.0.0.

shell namespace 1.0.0 and 1.1.0 are supported by Karaf 3.0.0.

Karaf 2.x only support shell namespace 1.0.0.

Regards
JB

On 01/22/2014 09:48 AM, Roedl Lukas wrote:
> Hi JB,
>
> I've tested it once again and I still get an error when deploying a command with version 1.1.0 in Karaf 2.3.3:
>
> [ERROR] BlueprintContainerImpl - Unable to start blueprint container 
> for bundle at.ac.ait.hbs.homer.core.shell.scheduler
> org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml
>          at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:288)
>          at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:313)
>          at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
>          at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:259)
>          at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:222)
>          ...
>          at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.4: Attribute 'name' must appear on element 'command'.
>          at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[:]
>          ...
>          ... 29 more
>
> My command looks like this:
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>          xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
>              http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>      <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0" xsi:schemaLocation="http://karaf.apache.org/xmlns/shell/v1.1.0 http://karaf.apache.org/xmlns/shell/v1.1.0">
>          <command>
>              <action class="at.ac.ait.hbs.homer.core.shell.scheduler.commands.SchedulerList">
>              </action>
>          </command>
>      </command-bundle>
> </blueprint>
>
> Best regards,
>
> Lukas
>
> -----Ursprüngliche Nachricht-----
> Von: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Gesendet: Mittwoch, 22. Januar 2014 07:30
> An: user@karaf.apache.org
> Betreff: Re: AW: Schema for custom shell commands
>
> Hi Vinu,
>
> I checked and if you use shell namespace 1.1.0, you have to NOT use the name attribute on the command element (the name is now taken from the command class).
> The name attribute is required only if you use shell namespace 1.0.0.
>
> However, namespace 1.0.0 is still supported in Karaf 3.0.0.
>
> Regards
> JB
>
> On 01/22/2014 07:26 AM, Vinu Raj wrote:
>> Any further updates on this issue. I am using karaf 3.0.0 and facing 
>> the same issue. With namespace v1.1.0 and command element with about 
>> name attribute, getting following error.
>>
>> Caused by:
>> org.osgi.service.blueprint.container.ComponentDefinitionException:
>> Unable to find a matching factory method getScope on class 
>> org.apache.karaf.shell.console.commands.NamespaceHandler for 
>> arguments [com.test.cmd.list] when instanciating bean #recipe-7
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp
>> 4 029047p4031242.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
>

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

Re: AW: AW: Schema for custom shell commands

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
shell namespace 1.1.0 is only available with Karaf 3.0.0.

shell namespace 1.0.0 and 1.1.0 are supported by Karaf 3.0.0.

Karaf 2.x only support shell namespace 1.0.0.

Regards
JB

On 01/22/2014 09:48 AM, Roedl Lukas wrote:
> Hi JB,
>
> I've tested it once again and I still get an error when deploying a command with version 1.1.0 in Karaf 2.3.3:
>
> [ERROR] BlueprintContainerImpl - Unable to start blueprint container for bundle at.ac.ait.hbs.homer.core.shell.scheduler
> org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml
>          at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:288)
>          at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:313)
>          at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
>          at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:259)
>          at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:222)
>          ...
>          at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.4: Attribute 'name' must appear on element 'command'.
>          at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[:]
>          ...
>          ... 29 more
>
> My command looks like this:
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
>          xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
>              http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
>      <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0" xsi:schemaLocation="http://karaf.apache.org/xmlns/shell/v1.1.0 http://karaf.apache.org/xmlns/shell/v1.1.0">
>          <command>
>              <action class="at.ac.ait.hbs.homer.core.shell.scheduler.commands.SchedulerList">
>              </action>
>          </command>
>      </command-bundle>
> </blueprint>
>
> Best regards,
>
> Lukas
>
> -----Ursprüngliche Nachricht-----
> Von: Jean-Baptiste Onofré [mailto:jb@nanthrax.net]
> Gesendet: Mittwoch, 22. Januar 2014 07:30
> An: user@karaf.apache.org
> Betreff: Re: AW: Schema for custom shell commands
>
> Hi Vinu,
>
> I checked and if you use shell namespace 1.1.0, you have to NOT use the name attribute on the command element (the name is now taken from the command class).
> The name attribute is required only if you use shell namespace 1.0.0.
>
> However, namespace 1.0.0 is still supported in Karaf 3.0.0.
>
> Regards
> JB
>
> On 01/22/2014 07:26 AM, Vinu Raj wrote:
>> Any further updates on this issue. I am using karaf 3.0.0 and facing
>> the same issue. With namespace v1.1.0 and command element with about
>> name attribute, getting following error.
>>
>> Caused by:
>> org.osgi.service.blueprint.container.ComponentDefinitionException:
>> Unable to find a matching factory method getScope on class
>> org.apache.karaf.shell.console.commands.NamespaceHandler for arguments
>> [com.test.cmd.list] when instanciating bean #recipe-7
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4
>> 029047p4031242.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
>

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

AW: AW: Schema for custom shell commands

Posted by Roedl Lukas <Lu...@ait.ac.at>.
Hi JB,

I've tested it once again and I still get an error when deploying a command with version 1.1.0 in Karaf 2.3.3:

[ERROR] BlueprintContainerImpl - Unable to start blueprint container for bundle at.ac.ait.hbs.homer.core.shell.scheduler
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml
        at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:288)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:313)
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)
        at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:259)
        at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:222)
        ...
        at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.4: Attribute 'name' must appear on element 'command'.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[:]
        ...
        ... 29 more

My command looks like this:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
        xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0
            http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
    <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0" xsi:schemaLocation="http://karaf.apache.org/xmlns/shell/v1.1.0 http://karaf.apache.org/xmlns/shell/v1.1.0">
        <command>
            <action class="at.ac.ait.hbs.homer.core.shell.scheduler.commands.SchedulerList">
            </action>
        </command>
    </command-bundle>
</blueprint>

Best regards,

Lukas

-----Ursprüngliche Nachricht-----
Von: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Gesendet: Mittwoch, 22. Januar 2014 07:30
An: user@karaf.apache.org
Betreff: Re: AW: Schema for custom shell commands

Hi Vinu,

I checked and if you use shell namespace 1.1.0, you have to NOT use the name attribute on the command element (the name is now taken from the command class).
The name attribute is required only if you use shell namespace 1.0.0.

However, namespace 1.0.0 is still supported in Karaf 3.0.0.

Regards
JB

On 01/22/2014 07:26 AM, Vinu Raj wrote:
> Any further updates on this issue. I am using karaf 3.0.0 and facing 
> the same issue. With namespace v1.1.0 and command element with about 
> name attribute, getting following error.
>
> Caused by:
> org.osgi.service.blueprint.container.ComponentDefinitionException: 
> Unable to find a matching factory method getScope on class 
> org.apache.karaf.shell.console.commands.NamespaceHandler for arguments 
> [com.test.cmd.list] when instanciating bean #recipe-7
>
>
>
>
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4
> 029047p4031242.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: AW: Schema for custom shell commands

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

I checked and if you use shell namespace 1.1.0, you have to NOT use the 
name attribute on the command element (the name is now taken from the 
command class).
The name attribute is required only if you use shell namespace 1.0.0.

However, namespace 1.0.0 is still supported in Karaf 3.0.0.

Regards
JB

On 01/22/2014 07:26 AM, Vinu Raj wrote:
> Any further updates on this issue. I am using karaf 3.0.0 and facing the same
> issue. With namespace v1.1.0 and command element with about name attribute,
> getting following error.
>
> Caused by:
> org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
> find a matching factory method getScope on class
> org.apache.karaf.shell.console.commands.NamespaceHandler for arguments
> [com.test.cmd.list] when instanciating bean #recipe-7
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4029047p4031242.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: AW: Schema for custom shell commands

Posted by Vinu Raj <vi...@wipro.com>.
Any further updates on this issue. I am using karaf 3.0.0 and facing the same
issue. With namespace v1.1.0 and command element with about name attribute,
getting following error.

Caused by:
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to
find a matching factory method getScope on class
org.apache.karaf.shell.console.commands.NamespaceHandler for arguments
[com.test.cmd.list] when instanciating bean #recipe-7




--
View this message in context: http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4029047p4031242.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: AW: Schema for custom shell commands

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

I gonna check but, even it doesn't use it, Karaf 3.0.0 should support 
the name attribute (it's not used at all, but anyway, it should not be 
an issue).

I keep you posted.

Regards
JB

On 07/04/2013 02:07 PM, Roedl Lukas wrote:
> Unfortunately the online tool stripped the code snippets - so here is the complete message:
>
> I'm a bit confused about this one ;-)
>
> I use the following command:
>
>   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
>          <command name="homer/list">
>                  ...
>
> If I start the bundle in Karaf 2.3.1 everything is fine, but when started in Karaf 3.0.0.RC1 there is an "Unable to validate xml" error as described in the first post.
>
> When I now remove the name attribute:
>
>   <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
>          <command>
>                  ...
>
> I get an error in Karaf 2.3.1 that says that the name attribute is missing but in Karaf 3.0.0.RC1 it's working.
>
> Any idea how to get a bundle with commands working in both versions of Karaf?
>
> Best regards,
> Lukas
>

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

AW: Schema for custom shell commands

Posted by Roedl Lukas <Lu...@ait.ac.at>.
Unfortunately the online tool stripped the code snippets - so here is the complete message:

I'm a bit confused about this one ;-)

I use the following command:

 <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
        <command name="homer/list">
                ...

If I start the bundle in Karaf 2.3.1 everything is fine, but when started in Karaf 3.0.0.RC1 there is an "Unable to validate xml" error as described in the first post.

When I now remove the name attribute:

 <command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
        <command>
                ...

I get an error in Karaf 2.3.1 that says that the name attribute is missing but in Karaf 3.0.0.RC1 it's working.

Any idea how to get a bundle with commands working in both versions of Karaf?

Best regards,
Lukas

Re: Schema for custom shell commands

Posted by roedll <lu...@ait.ac.at>.
I'm a bit confused about this one ;-)

I use the following command:


If I start the bundle in Karaf 2.3.1 everything is fine, but when started in
Karaf 3.0.0.RC1 there is an "Unable to validate xml" error as described in
the first post.

When I now remove the name attribute:


I get an error in Karaf 2.3.1 that says that the name attribute is missing
but in Karaf 3.0.0.RC1 its working.

Any idea how to get a bundle with commands working in both versions of
Karaf?



--
View this message in context: http://karaf.922171.n3.nabble.com/Schema-for-custom-shell-commands-tp4029047p4029221.html
Sent from the Karaf - User mailing list archive at Nabble.com.