【问题标题】:Unable to start blueprint container - Hello World无法启动蓝图容器 - Hello World
【发布时间】:2018-01-12 07:50:47
【问题描述】:

我是 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.access$900(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 链接完全相同(这是我创建的存储库 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

谢谢大家,

丹尼尔·罗梅罗·莫西洛

【问题讨论】:

  • 这就是您拥有的所有错误详细信息吗?试试 diag 命令。也许你会得到更多的细节。你也可以尝试在你的代码中加入一些日志语句,看看它失败的地方。
  • 我添加了有关错误的新信息。很抱歉,我对 Opendaylight 没有深入的了解,所以我需要一些帮助。

标签: osgi karaf sdn opendaylight


【解决方案1】:

在您提供的日志中:

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

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

如果它与您提供的链接中的 [here] 完全相同,则第 19 行中有一些额外的字符

【讨论】:

  • 伙计,我真是个白痴。我花了很多时间检查这种错误。我需要多一双眼睛。谢谢!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-28
  • 2021-09-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多