[CONTROLLER-169] PUT toaster:toaster on toaster sample throwing exception, indicator of [de] serialization issue Created: 20/Feb/14 Updated: 25/Jul/23 Due: 22/Apr/14 Resolved: 21/May/14 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | mdsal |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | David Bainbridge | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Mac OS |
||
| Issue Links: |
|
||||||||
| External issue ID: | 442 | ||||||||
| Priority: | Normal | ||||||||
| Description |
|
Attempting to to a PUT /restconf/config/toaster:toaster/ HTTP/1.1 { "toaster:toaster" : { "toasterManufacturer" : "foo", "toasterModelNumber" : "1234567", "toasterStatus" : "up" }} returns 200 Ok, causes an exception in the log (below) and does not reflect any data change in the operational store. 2014-02-20 14:02:22.950 PST [pool-20-thread-3] ERROR o.o.y.s.b.g.i.LazyGeneratedCodecRegistry - Could not find loaded class for path: SchemaPath [path=[(http://netconfcentral.org/ns/toaster?revision=2009-11-20)toaster], absolute=true] and type: org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.Toaster |
| Comments |
| Comment by Tony Tkacik [ 21/Feb/14 ] |
|
Hi David, The exception itself is bit confusing, so I would suggest improving error reporting, that no-one is actually listening to that data, rather then showing exception (this exception is correct state), but confuses people that something is broken inside MD-SAL. |
| Comment by David Bainbridge [ 21/Feb/14 ] |
|
So presumably what is happening is that after the data is put into the config store, the SAL wants to send a notification to anyone listening that the config data has changed. Either the SAL knows that no one has registered to listen, in which case it would not need to deserialize the data or the SAL is blind to the list of listeners and thus needs to deserialize the data an attempt to send an event that no one receives. If the SAL knows no one is listening, then I would think no deserialization would ever take place, it could just issue an error / warning because some configuration data was pushed that will never be used. If the SAL is not aware then I can see that it might attempt to deserialize the data depending on the code path, but I am not sure why that would cause an exception. Presumably the Java DTO objects can be found that represent the data and thus the data could be mashalled into those objects. So I guess the question is, what is being deserialized that causes the failures? I haven't walked this with the debugger yet, as my assumption was this was related to the other bugs with serialization around the toaster example. I agree a warning or error indicating no one is listening and the data is essentially unused is valid. |
| Comment by David Bainbridge [ 21/Feb/14 ] |
|
So I added a data provider listener to the toaster example and attempted a put, now I am getting the below exception, so i still think there may a bug here. 2014-02-21 11:48:09.187 PST [pool-20-thread-4] ERROR o.o.c.s.b.i.c.d.BindingIndependentConnector - Ommiting from BA transaction: /(http://netconfcentral.org/ns/toaster?revision=2009-11-20)toaster. |
| Comment by Tony Tkacik [ 09/Apr/14 ] |
|
Other ways to reproduce: 2014-03-13 15:12:35 PDT [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/restconf].[JAXRSRestconf]] SEVERE org.apache.catalina.core.StandardWrapperValve invoke Servlet.service() for servlet [JAXRSRestconf] in context with path [/restconf] threw exception [java.util.concurrent.ExecutionException: java.lang.IllegalStateException: leaf node-connector-type { enum "ALL" { value 1; description "Represents the OFPP_ALL reserved OF port to forward to ALL the ports in the system , should be used for flooding like mechanism to be used cautiously to avoid excessive flooding."; }And the value is passed in via RestConf as let's say "ALL", then YANGTools fails with the following ClassCastException. org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException: java.lang.ClassCastException: java.lang.String cannot be cast to org.opendaylight.yang.gen.v1.urn.opendaylight.host.tracker.rev140305.host.NodeConnector$NodeConnectorType] with root cause |
| Comment by Tony Tkacik [ 21/May/14 ] |
|
With new default datastore this does not happen. |