[CONTROLLER-1541] UnmarshalException: unexpected element (uri:"urn:opendaylight:netvirt:aclservice-config", local:"aclservice-config"). Expected elements are <{}snapshot> Created: 25/Aug/16  Updated: 25/Jul/23  Resolved: 27/Mar/17

Status: Resolved
Project: controller
Component/s: config
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Michael Vorburger Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 6535

 Description   

2016-08-25 19:01:07,757 | WARN | r - ConfigPusher | AbstractFeatureWrapper | 141 - config-persister-feature-adapter - 0.6.0.SNAPSHOT | Unable to parse configuration snapshot. Config from 'etc/opendaylight/datastore/initial/config/netvirt-aclservice-config.xml' will be IGNORED. Note that subsequent config files may fail due to this problem. Xml markup in this file needs to be fixed, for detailed information see enclosed exception.
javax.xml.bind.UnmarshalException

  • with linked exception:
    [javax.xml.bind.UnmarshalException: unexpected element (uri:"urn:opendaylight:netvirt:aclservice-config", local:"aclservice-config"). Expected elements are <{}snapshot>]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:468)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:402)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:371)[:1.8.0_101]
    at org.opendaylight.controller.configpusherfeature.internal.FeatureConfigSnapshotHolder.<init>(FeatureConfigSnapshotHolder.java:74)[141:config-persister-feature-adapter:0.6.0.SNAPSHOT]
    at org.opendaylight.controller.configpusherfeature.internal.AbstractFeatureWrapper.getFeatureConfigSnapshotHolder(AbstractFeatureWrapper.java:75)[141:config-persister-feature-adapter:0.6.0.SNAPSHOT]
    at org.opendaylight.controller.configpusherfeature.internal.AbstractFeatureWrapper.getFeatureConfigSnapshotHolders(AbstractFeatureWrapper.java:60)[141:config-persister-feature-adapter:0.6.0.SNAPSHOT]
    at org.opendaylight.controller.configpusherfeature.internal.ChildAwareFeatureWrapper.getFeatureConfigSnapshotHolders(ChildAwareFeatureWrapper.java:85)[141:config-persister-feature-adapter:0.6.0.SNAPSHOT]
    at org.opendaylight.controller.configpusherfeature.internal.FeatureConfigPusher.pushConfig(FeatureConfigPusher.java:83)[141:config-persister-feature-adapter:0.6.0.SNAPSHOT]
    at org.opendaylight.controller.configpusherfeature.internal.FeatureConfigPusher.pushConfigs(FeatureConfigPusher.java:67)[141:config-persister-feature-adapter:0.6.0.SNAPSHOT]
    at org.opendaylight.controller.configpusherfeature.internal.ConfigPushingRunnable.processFeatureEvent(ConfigPushingRunnable.java:65)[141:config-persister-feature-adapter:0.6.0.SNAPSHOT]
    at org.opendaylight.controller.configpusherfeature.internal.ConfigPushingRunnable.run(ConfigPushingRunnable.java:47)[141:config-persister-feature-adapter:0.6.0.SNAPSHOT]
    at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
    Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"urn:opendaylight:netvirt:aclservice-config", local:"aclservice-config"). Expected elements are <{}snapshot>
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:726)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:247)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:242)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:109)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:1131)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:556)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:538)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:60)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleStartElement(StAXStreamConnector.java:231)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:165)[:1.8.0_101]
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:400)[:1.8.0_101]
    ... 10 more
    Caused by: javax.xml.bind.UnmarshalException: unexpected element (uri:"urn:opendaylight:netvirt:aclservice-config", local:"aclservice-config"). Expected elements are <{}snapshot>
    ... 21 more


 Comments   
Comment by Michael Vorburger [ 25/Aug/16 ]

Copy/paste of my analysis of this problem from private email exchange:

From what I gathered it seems Karaf has some concept of XML configuration files per feature, yes? Those files can be any kind of XML, not just ODL CSS config XML, yes? If that's so, then it is simply wrong of AbstractFeatureWrapper to view the world as simple as it's current implementation does - note its CONFIG_FILE_SUFFIX = "xml" and Files.getFileExtension(c.getFinalname()).equals(CONFIG_FILE_SUFFIX) and then it tries to unmarshal that XML using JAXB, on the off chance that this XML is a CSS XML for it to handle with its schema.. and it then makes a dumb assumption that catch (JAXBException e) catches problems in CSS config, which it logs as warn with message pretending the file in a question is a bad CSS config file (which e.g. aclservice-config_aclservice-config.xml isn't at all, right? It seems to be ... whatever else; not important here, right?), and with catch (XMLStreamException e) wants to catch (inline comment in code) "Files that cannot be loaded are ignored as non config subsystem files e.g. jetty.xml" - that's... naive, and not working for you here.

IMHO AbstractFeatureWrapper should be made smarter about finding out if a Karaf Feature XML configuration file is for ODL Config CSS. Not 100% sure how I would do that, Controller Configuration folks may have a better idea. One way would be to perhaps peek at the XML file to see it's root element, using DOM instead of JAXB? It's been a while since I did stuff like that. Some sort of XML file name convention, or directory placement, would perhaps be an alternative?

Comment by Michael Vorburger [ 25/Aug/16 ]

https://git.opendaylight.org/gerrit/#/c/44185/ was to take care of this problem, but had to be reverted it seems.

Comment by Michael Vorburger [ 26/Aug/16 ]

https://git.opendaylight.org/gerrit/#/c/44669/ is the new Gerrit from Tom about this.

Generated at Wed Feb 07 19:55:48 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.