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.

Reply via email to