无法启动蓝图容器 - Hello World

Unable to start blueprint container - Hello World

我是 Opendaylight 的新手,我正在按照教程构建一个简单的 Hello World 项目 (this tutorial),但是当我 运行 使用 ./karaf 的项目并检查是否模块初始化为 log:display | grep hello 我得到这个错误:

2017-08-04 12:43:57,159 | INFO  | Event Dispatcher | YangTextSchemaContextResolver    | 55 - org.opendaylight.yangtools.yang-parser-impl - 1.0.2.Boron-SR2 | Provided module name /META-INF/yang/hello.yang@0000-00-00.yang does not match actual text hello@2015-01-05.yang, corrected
2017-08-04 12:44:01,928 | INFO  | Event Dispatcher | YangTextSchemaContextResolver    | 55 - org.opendaylight.yangtools.yang-parser-impl - 1.0.2.Boron-SR2 | Provided module name /META-INF/yang/hello.yang@0000-00-00.yang does not match actual text hello@2015-01-05.yang, corrected
2017-08-04 12:44:08,295 | INFO  | Event Dispatcher | BlueprintBundleTracker           | 148 - org.opendaylight.controller.blueprint - 0.5.2.Boron-SR2 | Creating blueprint container for bundle org.opendaylight.hello.impl_0.1.0.SNAPSHOT [174] with paths [bundleentry://174.fwk592688102/org/opendaylight/blueprint/impl-blueprint.xml]
2017-08-04 12:44:08,318 | ERROR | Event Dispatcher | BlueprintContainerImpl           | 15 - org.apache.aries.blueprint.core - 1.6.1 | Unable to start blueprint container for bundle org.opendaylight.hello.impl/0.1.0.SNAPSHOT

使用 diag 命令我得到这个输出:

opendaylight-user@root>diag
hello-impl (174)
----------------
Status: Failure
Blueprint
4/08/17 14:12
Exception: 
Unable to validate xml
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml
    at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:349)
    at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:336)
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:343)
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:276)
    at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:300)
    at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:269)
    at org.apache.aries.blueprint.container.BlueprintExtender.access0(BlueprintExtender.java:68)
    at org.apache.aries.blueprint.container.BlueprintExtender$BlueprintContainerServiceImpl.createContainer(BlueprintExtender.java:602)
    at org.opendaylight.controller.blueprint.BlueprintBundleTracker.modifiedBundle(BlueprintBundleTracker.java:178)
    at org.opendaylight.controller.blueprint.BlueprintBundleTracker.addingBundle(BlueprintBundleTracker.java:159)
    at org.opendaylight.controller.blueprint.BlueprintBundleTracker.addingBundle(BlueprintBundleTracker.java:51)
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:467)
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:414)
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
    at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:443)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:847)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivileged(Framework.java:1568)
    at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1504)
    at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framework.java:1499)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:391)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
    at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
    at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.3: Element 'blueprint' cannot have character [children], because the type's content type is element-only.
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.elementLocallyValidType(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.processElementContent(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.handleEndElement(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.endElement(Unknown Source)
    at org.apache.xerces.jaxp.validation.DOMValidatorHelper.finishNode(Unknown Source)
    at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source)
    at org.apache.xerces.jaxp.validation.DOMValidatorHelper.validate(Unknown Source)
    at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source)
    at javax.xml.validation.Validator.validate(Unknown Source)
    at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:346)
    ... 32 more

正如我所说,我一直在学习教程,所以我的文件与 opendaylight link 完全相同(这是我创建的存储库 GitHub)。

我认为说出我是如何产生的很重要。这是代码:

mvn archetype:generate -DarchetypeGroupId=org.opendaylight.controller -DarchetypeArtifactId=opendaylight-startup-archetype -DarchetypeRepository=https://nexus.opendaylight.org/content/repositories/public/ -DarchetypeCatalog=remote -DarchetypeVersion=1.2.2-Boron-SR2

谢谢大家,

丹尼尔·罗梅罗·莫西洛

在您提供的日志中:

Element 'blueprint' cannot have character [children], because the type's content type is element-only.

所以我认为您的蓝图文件中存在一些错误(无效 XML)。

如果它与您提供的 link 中的完全一样 [here] 则第 19 行有一些额外的字符