[YANGTOOLS-1527] Incorrect XML attribute namespace Created: 21/Jul/23  Updated: 25/Jul/23  Resolved: 21/Jul/23

Status: Resolved
Project: yangtools
Component/s: codecs
Affects Version/s: 11.0.0, 9.0.8, 10.0.8
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Sangwook Ha Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates YANGTOOLS-982 Split out XML attribute handling Confirmed
Relates
relates to NETCONF-856 Integrate message-id and other NETCON... Confirmed

 Description   

XMLParserStream fails to find the namespace of XML attribute message-id in the rpc-reply element like this:

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-1">

and generates this warning message:

2023-07-21T18:49:38,044 | INFO  | globalWorkerGroup-3-1 | StreamWriterFacade               | 303 - org.opendaylight.yangtools.yang-data-codec-xml - 11.0.0 | Encountered annotation message-id not bound to module. Please examine the call stack and fix this warning by defining a proper YANG annotation to cover it
java.lang.Throwable: Call stack
	at org.opendaylight.yangtools.yang.data.codec.xml.StreamWriterFacade.warnLegacyAttribute(StreamWriterFacade.java:307) ~[bundleFile:?]
	at org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream.getElementAttributes(XmlParserStream.java:375) ~[bundleFile:?]
	at org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream.read(XmlParserStream.java:448) ~[bundleFile:?]
	at org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream.parse(XmlParserStream.java:330) ~[bundleFile:?]
	at org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream.traverse(XmlParserStream.java:357) ~[bundleFile:?]
	at org.opendaylight.netconf.client.mdsal.impl.NetconfMessageTransformer.parseResult(NetconfMessageTransformer.java:484) ~[bundleFile:?]
	at org.opendaylight.netconf.client.mdsal.impl.NetconfMessageTransformer.toRpcResult(NetconfMessageTransformer.java:436) ~[bundleFile:?]
	at org.opendaylight.netconf.client.mdsal.impl.NetconfMessageTransformer.toRpcResult(NetconfMessageTransformer.java:104) ~[bundleFile:?]
	at org.opendaylight.netconf.client.mdsal.spi.NetconfDeviceRpc$1.onSuccess(NetconfDeviceRpc.java:61) ~[bundleFile:?]
	at org.opendaylight.netconf.client.mdsal.spi.NetconfDeviceRpc$1.onSuccess(NetconfDeviceRpc.java:56) ~[bundleFile:?]
	at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1133) ~[bundleFile:?]
	at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
	at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286) ~[bundleFile:?]
	at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055) ~[bundleFile:?]
	at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782) ~[bundleFile:?]
	at org.opendaylight.netconf.client.mdsal.UncancellableFuture.set(UncancellableFuture.java:45) ~[bundleFile:?]
	at org.opendaylight.netconf.client.mdsal.NetconfDeviceCommunicator.processMessage(NetconfDeviceCommunicator.java:299) ~[bundleFile:?]
	at org.opendaylight.netconf.client.mdsal.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:218) ~[bundleFile:?]
	at org.opendaylight.netconf.client.mdsal.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:48) ~[bundleFile:?]
	at org.opendaylight.netconf.nettyutil.AbstractNetconfSession.handleMessage(AbstractNetconfSession.java:68) ~[bundleFile:?]
	at org.opendaylight.netconf.nettyutil.AbstractNetconfSession.channelRead0(AbstractNetconfSession.java:195) ~[bundleFile:?]
	at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[bundleFile:4.1.94.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[bundleFile:4.1.94.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[bundleFile:4.1.94.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[bundleFile:4.1.94.Final]
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:61) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:425) ~[bundleFile:4.1.94.Final]
	at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[bundleFile:4.1.94.Final]
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[bundleFile:4.1.94.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[bundleFile:4.1.94.Final]
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[bundleFile:4.1.94.Final]
	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[bundleFile:4.1.94.Final]
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[bundleFile:4.1.94.Final]
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[bundleFile:4.1.94.Final]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]


 Comments   
Comment by Sangwook Ha [ 21/Jul/23 ]

Okay, this seems to be the correct behavior. Namespaces in XML 1.0 Section 6.2 Namespace Defaulting:

The scope of a default namespace declaration extends from the beginning of the start-tag in which it appears to the end of the corresponding end-tag, excluding the scope of any inner default namespace declarations. In the case of an empty tag, the scope is the tag itself.

A default namespace declaration applies to all unprefixed element names within its scope. Default namespace declarations do not apply directly to attribute names; the interpretation of unprefixed attributes is determined by the element on which they appear.

Default namespace only applies to unprefixed element names but to attribute names.

Generated at Wed Feb 07 20:56:25 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.