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:[email protected]] 
Gesendet: Mittwoch, 22. Januar 2014 07:30
An: [email protected]
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é
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to