[CONTROLLER-679] Restconf cannot deserialize leaf whose type is defined in another module Created: 12/Aug/14 Updated: 25/Jul/23 Resolved: 14/Aug/14 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | mdsal |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Ashwin Pankaj | Assignee: | Ashwin Pankaj |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| Attachments: |
|
| External issue ID: | 1528 |
| Description |
|
Define two yang models as follows types.yang module types { description revision 2014-07-05 { description "Initial version."; }typedef Name { type string { length "1..64"; } description "This data type is used to model a name "; } } test.yang ======== module test { namespace "urn:ping:params:xml:ns:yang:test"; prefix "test"; import types { prefix "types"; } description "Test "; revision 2014-07-05 { description "Initial version."; } container test-container { } Now try to set via restconf - org.opendaylight.yangtools.yang.binding.util.ClassLoaderUtils.loadClass fails with java.lang.ClassNotFoundException. This is because SAl is searching the package of "test" for "types" class. |
| Comments |
| Comment by Jozef Gloncak [ 12/Aug/14 ] |
|
I am just guessing. Couldn't be problem that you are reffering module types in module test via incorrect prefix (test:Name instead of types:Name) container test-container { } |
| Comment by Ashwin Pankaj [ 12/Aug/14 ] |
|
That was a typo. |
| Comment by Jozef Gloncak [ 12/Aug/14 ] |
|
(In reply to Ashwin Pankaj from comment #2) does it mean that now it is ok or that it was typo here in bugzila and problem still exist? |
| Comment by Jan Hajnar [ 12/Aug/14 ] |
|
Hi, After trying with today's build (August 12th) and correcting errors in your input and model: path: path: Please provide feedback if this issue is fixed or still persists. |
| Comment by Ashwin Pankaj [ 13/Aug/14 ] |
|
I am sorry I forgot to add one important detail - the exception occurs when a registered org.opendaylight,controller.md.sal.binding.api.DataChangelistener tries to retrieve the updates to the config store using getupdatedData. I have attached a sample stack trace. |
| Comment by Ashwin Pankaj [ 13/Aug/14 ] |
|
Attachment stack_trace.png has been added with description: stack trace |
| Comment by Ashwin Pankaj [ 14/Aug/14 ] |
|
The method suggested by Jan works for me. I was using DataBroker SAL service to register for changes. This would trigger events but I was not able to get updated data. The fix is to implement dataChangeListener as mentioned in https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Toaster_Step-By-Step |