[CONTROLLER-949] RPC register exception when rpc has no input Created: 21/Oct/14  Updated: 25/Jul/23  Due: 31/Oct/14  Resolved: 09/Nov/14

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

Type: Bug
Reporter: Oscar Assignee: Jan Hajnar
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File ERROR.TXT    
External issue ID: 2233

 Description   

Working with RPCs defined in the yang I got tis exception:

2014-10-19 16:36:43.877 CEST [config-pusher] ERROR o.o.c.s.b.i.RpcProviderRegistryImpl - Unhandled exception during invoking listener {}
java.util.NoSuchElementException: null

<< FIND ATTACHED THE FULL STACK TRACE >>

After some tests I discovered that the exception is thrown when defining a RPC without an input. Output is optional and everything works well if there isn't an output declared.

Let me show you some examples:
rpc nothing { } DOESN'T WORK
rpc only-output { output { leaf foo

{ type string;}

} } DOESN'T WORK
rpc empty-input { input { } } WORKS

Notice that input doesn't have to contain anything. When calling this RPC from java, just use the input builder for building an empty input object. When calling it from RESTconf, just post { input: { } }.



 Comments   
Comment by Oscar [ 21/Oct/14 ]

Attachment ERROR.TXT has been added with description: Full stack trace

Comment by Jan Hajnar [ 31/Oct/14 ]

fix:
https://git.opendaylight.org/gerrit/#/c/12401/

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