Hi,
I am trying to create a bundle that will provide me with custom commands in
the console.
My blueprint file looks like this:
blueprint xmlns=*http://www.osgi.org/xmlns/blueprint/v1.0.0*
command-bundle xmlns=*http://karaf.apache.org/xmlns/shell/v1.1.0*
command name=*test/sample*
action class=*com.test.sample.shell.commands.SampleCommand* /
/command
/command-bundle
/blueprint
The pom.xml has the bundle-plugin configured like this:
plugin
groupIdorg.apache.felix/groupId
artifactIdmaven-bundle-plugin/artifactId
version2.3.7/version
extensionstrue/extensions
configuration
instructions
Import-Package
org.apache.felix.service.command,
org.apache.karaf.shell.commands,
org.apache.karaf.shell.console,
org.osgi.service.blueprint.container,
org.osgi.service.blueprint.reflect,
org.apache.aries.blueprint,
*
/Import-Package
/instructions
/configuration
/plugin
However, when I deploy this to Karaf 3.0-SNAPSHOT, I am getting the
following error:
Unable to start blueprint container for bundle
com.fico.ifm.scheduler.shell.commands
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable
to validate xml
at
org.apache.aries.blueprint.parser.Parser.validate(Parser.java:288)[25:org.apache.aries.blueprint.core:1.0.1]
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:304)[25:org.apache.aries.blueprint.core:1.0.1]
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:252)[25:org.apache.aries.blueprint.core:1.0.1]
at
org.apache.aries.blueprint.container.BlueprintExtender.checkBundle(BlueprintExtender.java:315)[25:org.apache.aries.blueprint.core:1.0.1]
at
org.apache.aries.blueprint.container.BlueprintExtender.bundleChanged(BlueprintExtender.java:235)[25:org.apache.aries.blueprint.core:1.0.1]
at
org.apache.aries.blueprint.container.BlueprintExtender$BlueprintBundleTrackerCustomizer.modifiedBundle(BlueprintExtender.java:434)[25:org.apache.aries.blueprint.core:1.0.1]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:198)[8:org.apache.aries.util:1.0.0]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:128)[8:org.apache.aries.util:1.0.0]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:468)[8:org.apache.aries.util:1.0.0]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:161)[8:org.apache.aries.util:1.0.0]
at
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:117)[8:org.apache.aries.util:1.0.0]
at
org.eclipse.osgi.framework.internal.core.Framework$10.call(Framework.java:1606)[osgi-3.8.0.v20120529-1548.jar:]
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.notifyHookPrivileged(ServiceRegistry.java:1239)[osgi-3.8.0.v20120529-1548.jar:]
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.notifyHooksPrivileged(ServiceRegistry.java:1222)[osgi-3.8.0.v20120529-1548.jar:]
at
org.eclipse.osgi.framework.internal.core.Framework.notifyEventHooksPrivileged(Framework.java:1603)[osgi-3.8.0.v20120529-1548.jar:]
at
org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1558)[osgi-3.8.0.v20120529-1548.jar:]
at
org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1505)[osgi-3.8.0.v20120529-1548.jar:]
at
org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1500)[osgi-3.8.0.v20120529-1548.jar:]
at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:391)[osgi-3.8.0.v20120529-1548.jar:]
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300)[osgi-3.8.0.v20120529-1548.jar:]
at
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[17:org.apache.felix.fileinstall:3.2.6]
at
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[17:org.apache.felix.fileinstall:3.2.6]
at
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:508)[17:org.apache.felix.fileinstall:3.2.6]
at
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[17:org.apache.felix.fileinstall:3.2.6]
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.6.0_24]
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)[:1.6.0_24]
at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:387)[:1.6.0_24]
at