[CONTROLLER-1364] Can not invoke zero argument RPC exposed by a Netconf device mounted on ODL using Restconf Created: 09/Jun/15 Updated: 17/Jun/15 Resolved: 17/Jun/15 |
|
| Status: | Verified |
| Project: | controller |
| Component/s: | restconf |
| Affects Version/s: | Lithium |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Balaji Varadaraju | Assignee: | Vaclav Demcak |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||
| External issue ID: | 3650 | ||||||||
| Priority: | Normal | ||||||||
| Description |
|
If I invoke an RPC that takes zero arguments exposed by a Netconf device, I am getting the error below. This is not the case with the RPCs that takes some input arguments. java.lang.NullPointerException |
| Comments |
| Comment by Balaji Varadaraju [ 09/Jun/15 ] |
|
Wanted to add this is a zero input RPC but it provides some output. So looks like we have an error while processing the output. |
| Comment by Tom Pantelis [ 10/Jun/15 ] |
|
I assume it's getting into the RestconfImpl#invokeRpc method that takes the "noPayload" string. final ContainerSchemaNode rpcDataSchemaNode = It seems that resultNodeSchema is null. However I don't understand why this code is needed when the RpcDefinition was already found earlier. Why doesn't it just use that RpcDefinition for resultNodeSchema? The NormalizedNodeXmlBodyWriter and NormalizedNodeJsonBodyWriter check for schemaPath instanceof RpcDefinition and use the output schema path. |
| Comment by Tony Tkacik [ 10/Jun/15 ] |
|
Seems as left-over of some refactor: first call: Should return rpc/output container Second call: tries to look up output in rpc/output container instead of RPC. So it seems the resultNodeSchema should be simply = rpc.getOutput() resultNodeSchema = rpcDataSchemaNode.getDataChildByName( Will try to replicate and verify. |
| Comment by Tom Pantelis [ 10/Jun/15 ] |
|
Actually when I tried it with a no-input rpc with output, the code path was not thru the "noPayload" method but thru the NormalizedNodeContext ("with payload") method and getData() was null. The rpc worked correctly. I'll debug it with Bala to see the code path for his failed mounted rpc. |
| Comment by Vaclav Demcak [ 15/Jun/15 ] |